mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-15 09:21:25 +08:00
25 lines
548 B
Vue
25 lines
548 B
Vue
|
<script>
|
||
|
import * as AllDemo from '../demo'
|
||
|
|
||
|
export default {
|
||
|
props: {
|
||
|
name: String,
|
||
|
},
|
||
|
render () {
|
||
|
const name = this.name
|
||
|
const titleMap = {}
|
||
|
for (const [title] of Object.entries(AllDemo)) {
|
||
|
const key = `${title.replace(/(\B[A-Z])/g, '-$1').toLowerCase()}`
|
||
|
titleMap[key] = title
|
||
|
}
|
||
|
const Demo = AllDemo[titleMap[name.replace(/-cn\/?$/, '')]]
|
||
|
const hash = this.$route.hash.replace('#', '')
|
||
|
return (
|
||
|
<div id='iframe-page'>
|
||
|
<Demo iframeName={hash} />
|
||
|
</div>
|
||
|
)
|
||
|
},
|
||
|
}
|
||
|
</script>
|