mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
68 lines
1.2 KiB
Vue
68 lines
1.2 KiB
Vue
<template>
|
|
<div class="app">
|
|
<van-doc
|
|
:base="base"
|
|
:config="config"
|
|
active="Vue 组件"
|
|
:lang="$vantLang"
|
|
:simulators="simulators"
|
|
:search-config="searchConfig"
|
|
:current-simulator="currentSimulator"
|
|
>
|
|
<router-view @changeDemoURL="onChangeDemoURL" />
|
|
</van-doc>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import docConfig from './doc.config';
|
|
|
|
export default {
|
|
data() {
|
|
this.searchConfig = docConfig.searchConfig;
|
|
return {
|
|
simulators: [`mobile.html${location.hash}`],
|
|
demoURL: ''
|
|
};
|
|
},
|
|
|
|
computed: {
|
|
base() {
|
|
return `/${this.$vantLang}`;
|
|
},
|
|
|
|
config() {
|
|
return docConfig[this.$vantLang];
|
|
},
|
|
|
|
currentSimulator() {
|
|
const { name } = this.$route;
|
|
return name && name.indexOf('demo') !== -1 ? 1 : 0;
|
|
}
|
|
},
|
|
|
|
methods: {
|
|
onChangeDemoURL(url) {
|
|
this.simulators = [this.simulators[0], url];
|
|
}
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<style lang="less">
|
|
.van-doc-intro {
|
|
padding-top: 20px;
|
|
font-family: "Dosis", "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;
|
|
text-align: center;
|
|
|
|
&__logo {
|
|
width: 120px;
|
|
height: 120px;
|
|
}
|
|
|
|
p {
|
|
margin-bottom: 20px;
|
|
}
|
|
}
|
|
</style>
|