docs: simplify seciton name (#4961)

This commit is contained in:
neverland
2019-11-08 14:29:04 +08:00
committed by GitHub
parent e21c047306
commit 7ec7692918
12 changed files with 69 additions and 88 deletions
+1 -2
View File
@@ -38,8 +38,7 @@ function getQueryString(name) {
export default {
computed: {
title() {
const { name } = this.$route.meta;
return name ? name.replace(/-/g, '') : '';
return this.$route.meta.title || '';
},
showNav() {
+1 -3
View File
@@ -4,7 +4,7 @@
import Vue from 'vue';
import VueRouter from 'vue-router';
import VantDoc, { DemoBlock, DemoSection } from '@vant/doc';
import VantDoc from '@vant/doc';
import i18n from '../utils/i18n';
import Vant, { Lazyload, Locale } from '../../../src';
import { camelize } from '../../../src/utils/format/string';
@@ -18,8 +18,6 @@ Vue
});
Vue.mixin(i18n);
Vue.component('demo-block', DemoBlock);
Vue.component('demo-section', DemoSection);
Locale.add({
'zh-CN': {
+3 -3
View File
@@ -57,13 +57,13 @@ const registerRoute = ({ mobile, componentMap }) => {
}
route.push({
name: lang + '/' + path,
component,
name: `${lang}/${path}`,
path: `/${lang}/${path}`,
meta: {
lang,
path,
name: page.title
name: path,
title: page.title
}
});
}