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.
25 lines
548 B
25 lines
548 B
7 years ago
|
<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>
|