You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ant-design-vue/examples/components/demo.vue

29 lines
743 B

7 years ago
<script>
import { Menu } from 'antd'
7 years ago
import * as AllDemo from '../demo'
7 years ago
const MenuItem = Menu.Item
7 years ago
export default {
7 years ago
render () {
const { name, demo } = this.$route.params // eslint-disable-line
7 years ago
let { lang } = this.$route.params
7 years ago
const Demo = AllDemo[name]
7 years ago
if (lang !== 'cn') {
lang = 'us'
}
7 years ago
return (
7 years ago
<div class='site page-container'>
7 years ago
<Menu class='nav' selectedKeys={[name]}>
{Object.keys(AllDemo).map(d => <MenuItem key={d}>
7 years ago
<router-link to={{ path: `/components/${lang}/${d}` }}>{d}</router-link>
7 years ago
</MenuItem>)}
</Menu>
<div class='content'>
{Demo ? <Demo /> : '正在紧急开发中...'}
</div>
</div>
)
7 years ago
},
}
</script>