Commit 818234ba by 冒粤蓉

fix

1 parent ba685b20
......@@ -45,26 +45,21 @@ export default {
methods: {
...mapMutations(['updateBaseURL']),
getBreadcrumb() {
const { getters: {curBreadCrumb}} = this.$root.parentVuex;
let matched = this.$route.matched.filter(item => item.name); // this.$route.matched 可以获取到一个数组,包含当前路由的所有嵌套路径片段的路由记录
const first = matched[0];
const { meta, path } = first;
const basePath = '/system#';
const basePath = '/oEshield#';
let breadcrumb = [];
if(meta) {
const { title, parentTitle, parentPath } = meta;
if(parentTitle) {
breadcrumb.push({
name: parentTitle,
path: basePath + parentPath
})
}
if(title) {
const { title, pushState } = meta;
if(pushState && title) {
breadcrumb.push({
name: title,
path: basePath + path
})
this.$root.parentVuex.dispatch('menu/setBreadCrumb', [...curBreadCrumb, breadcrumb[0]]);
}
this.$root.parentVuex.dispatch('menu/setBreadCrumb', breadcrumb);
}
},
goToPage(path) {
......
......@@ -44,9 +44,8 @@ const routes = [
path: '/dictionaryManage/dictionaryData',
name: 'dictionaryData',
meta: {
title: '字典数据',
parentTitle: '字典管理',
parentPath: '/dictionaryManage',
title: '字典数据',
pushState: true
},
component: () => import('../views/dictionaryManage/dictionaryData/index.vue')
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!