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

29 lines
758 B
Vue
Raw Normal View History

2018-01-22 10:56:58 +00:00
<script>
import { Menu } from 'antd'
2018-01-24 07:39:21 +00:00
import * as AllDemo from '../demo'
2018-01-22 13:06:51 +00:00
const MenuItem = Menu.Item
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-01-24 07:39:21 +00:00
if (lang !== 'cn') {
lang = 'us'
}
2018-01-22 13:06:51 +00:00
return (
2018-01-23 10:55:39 +00:00
<div class='site page-container'>
2018-01-22 13:06:51 +00:00
<Menu class='nav' selectedKeys={[name]}>
{Object.keys(AllDemo).map(d => <MenuItem key={d}>
2018-01-24 07:39:21 +00:00
<router-link to={{ path: `/components/${lang}/${d}` }}>{d}</router-link>
2018-01-22 13:06:51 +00:00
</MenuItem>)}
</Menu>
2018-01-25 08:29:23 +00:00
<div class='content main-container'>
2018-01-22 13:06:51 +00:00
{Demo ? <Demo /> : '正在紧急开发中...'}
</div>
</div>
)
2018-01-22 10:56:58 +00:00
},
}
</script>