mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-25 02:41:46 +08:00
* fix: Tabbar icon line-height * [new feature] progress add showPivot prop * [new feature] TabItem support vue-router * [new feature] update document header style * [Doc] add toast english ducoment * [new feature] add i18n support * feat: Extract demos from markdown * feat: Base components demos * [new feature] complete demo extract & translate * [fix] text cases * fix: add deepAssign test cases * fix: changelog detail * [new feature] AddressEdit support i18n
47 lines
1006 B
Vue
47 lines
1006 B
Vue
<template>
|
|
<div class="app">
|
|
<van-doc :simulators="simulators" :currentSimulator="currentSimulator" :config="config" :base="base">
|
|
<router-view @changeDemoURL="onChangeDemoURL"></router-view>
|
|
</van-doc>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import docConfig from './doc.config';
|
|
|
|
export default {
|
|
data() {
|
|
if (window.location.host === 'www.youzanyun.com') {
|
|
const group = docConfig['zh-CN'].nav[0].groups[0];
|
|
group.list = group.list.filter(item => item.title !== '业务组件');
|
|
}
|
|
|
|
return {
|
|
simulators: [`/zanui/vant/examples${location.hash}`],
|
|
demoURL: ''
|
|
};
|
|
},
|
|
|
|
computed: {
|
|
base() {
|
|
return `/${this.$vantLang}/component`;
|
|
},
|
|
|
|
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>
|