docs(Field): split demo

This commit is contained in:
陈嘉涵
2020-02-03 11:56:57 +08:00
parent 69560f4fce
commit 143bd4297f
13 changed files with 452 additions and 253 deletions

View File

@@ -16,6 +16,8 @@ Locale.add({
// flag for vant-weapp demos
const isWeapp = location.search.indexOf('weapp=1') !== -1;
let demoUid = 0;
// helper for demo locales
Vue.mixin({
computed: {
@@ -37,6 +39,10 @@ Vue.mixin({
},
beforeCreate() {
if (!this.$options.name) {
this.$options.name = `demo-${demoUid++}`;
}
const { i18n, name } = this.$options;
if (i18n && name) {