mirror of
https://github.com/youzan/vant.git
synced 2025-12-23 01:00:44 +08:00
[Doc] add demo pages (#237)
* [bugfix] Checkbox border render error in weixin browser * [bugfix] TreeSelect dependency path error * [bugfix] Swipe should clear autoplay timer when destroyed * [bugfix] Optimize component dependency analyze when build style entry * merge * update yarn.lock * update README.md * update README.md * update README.md * update README.md * update README.md * [Doc] add more badges in README.md * update README.md * [bugfix] Address & Contact list style * fix: contact test cases * [bugfix] popup style missing when build style entry * [bugfix] Search: onSearch event arguments missing * [Doc] add demo pages * update zan-doc@0.3.7 * fix: build entry error
This commit is contained in:
61
docs/src/DocsApp.vue
Normal file
61
docs/src/DocsApp.vue
Normal file
@@ -0,0 +1,61 @@
|
||||
<template>
|
||||
<div class="app">
|
||||
<zan-doc :simulators="simulators" :currentSimulator="currentSimulator" :config="config" :base="base">
|
||||
<router-view @changeDemoURL="onChangeDemoURL"></router-view>
|
||||
</zan-doc>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import docConfig from './doc.config';
|
||||
import { getLang } from './utils/lang';
|
||||
|
||||
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/vue/examples${location.hash}`],
|
||||
demoURL: '',
|
||||
lang: getLang()
|
||||
};
|
||||
},
|
||||
|
||||
computed: {
|
||||
base() {
|
||||
return `/${this.lang}/component`;
|
||||
},
|
||||
|
||||
config() {
|
||||
return docConfig[this.lang];
|
||||
},
|
||||
|
||||
currentSimulator() {
|
||||
return this.$route.name === 'zh-CN/demo' ? 1 : 0;
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
'$route'(to) {
|
||||
this.lang = to.meta.lang;
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
onChangeDemoURL(url) {
|
||||
this.simulators = [this.simulators[0], url];
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="postcss">
|
||||
.zan-doc-content--quickstart {
|
||||
h3:not(:first-of-type) {
|
||||
margin-top: 35px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user