Commit efe8d2e2 by 冒粤蓉

fix menu

1 parent a843814a
......@@ -42,8 +42,8 @@ function render({ data = {} , container } = {}) {
router.beforeEach((to, from, next)=>{
const metaTitle = to.meta.title;
const thisBreadCrumb = data.store.getters.curBreadCrumb;
if(metaTitle) {
const thisBreadCrumb = data.store.getters.curBreadCrumb;
if(thisBreadCrumb) {
let nextChildren = {};
nextChildren = {
......@@ -53,9 +53,11 @@ function render({ data = {} , container } = {}) {
params: to.params
};
thisBreadCrumb.children.children = nextChildren;
data.store.dispatch('menu/setBreadCrumb', thisBreadCrumb);
}
} else {
thisBreadCrumb.children.children = '';
}
data.store.dispatch('menu/setBreadCrumb', thisBreadCrumb);
next();
})
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!