Commit 818234ba by 冒粤蓉

fix

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