ant-design-vue/examples/components/demo.vue

36 lines
1.0 KiB
Vue
Raw Normal View History

2018-01-22 10:56:58 +00:00
<script>
2018-01-24 07:39:21 +00:00
import * as AllDemo from '../demo'
2018-02-01 06:23:59 +00:00
import Header from './header'
2018-02-27 04:17:53 +00:00
import zhCN from 'antd/locale-provider/zh_CN'
import enUS from 'antd/locale-provider/default'
2018-01-22 10:56:58 +00:00
export default {
2018-01-22 13:06:51 +00:00
render () {
const { name, demo } = this.$route.params // eslint-disable-line
2018-01-24 07:39:21 +00:00
let { lang } = this.$route.params
2018-01-22 13:06:51 +00:00
const Demo = AllDemo[name]
2018-02-27 04:17:53 +00:00
let locale = zhCN
2018-01-24 07:39:21 +00:00
if (lang !== 'cn') {
lang = 'us'
2018-02-27 04:17:53 +00:00
locale = enUS
2018-01-24 07:39:21 +00:00
}
2018-01-22 13:06:51 +00:00
return (
2018-02-27 04:17:53 +00:00
<a-locale-provider locale={locale}>
<div class='site'>
<Header />
<div class='main-wrapper'>
<a-menu class='nav' selectedKeys={[name]}>
{Object.keys(AllDemo).map(d => <a-menu-item key={d}>
<router-link to={{ path: `/${lang}/components/${d}` }}>{d}</router-link>
</a-menu-item>)}
</a-menu>
<div class='content main-container'>
{Demo ? <Demo /> : '正在紧急开发中...'}
</div>
2018-02-01 06:23:59 +00:00
</div>
2018-01-22 13:06:51 +00:00
</div>
2018-02-27 04:17:53 +00:00
</a-locale-provider>
2018-01-22 13:06:51 +00:00
)
2018-01-22 10:56:58 +00:00
},
}
</script>