Commit 9693285e by 冒粤蓉

improve menu

1 parent 77c17659
......@@ -23,7 +23,6 @@ let router = null;
let instance = null;
function render({ data = {} , container } = {}) {
console.log('render innnnnn')
router = new VueRouter({
base: window.__POWERED_BY_QIANKUN__ ? '/system' : '/',
routes,
......@@ -40,6 +39,25 @@ function render({ data = {} , container } = {}) {
},
render: h => h(App),
}).$mount(container ? container.querySelector('#glsx-sub-system') : '#glsx-sub-system');
router.beforeEach((to,from,next)=>{
const metaTitle = to.meta.title;
if(metaTitle) {
const thisBreadCrumb = data.store.getters.curBreadCrumb;
if(thisBreadCrumb) {
let nextChildren = {};
nextChildren = {
active: true,
menuName: metaTitle,
path: '/system#' + to.path,
params: to.params
};
thisBreadCrumb.children.children = nextChildren;
data.store.dispatch('menu/setBreadCrumb', thisBreadCrumb);
}
}
next();
})
}
if (!window.__POWERED_BY_QIANKUN__) {
......
......@@ -38,6 +38,7 @@ const routes = [
{
path: '/dictionaryManage/dictionaryData',
name: 'dictionaryData',
meta: { title: '字典数据' },
component: () => import('../views/dictionaryManage/dictionaryData/index.vue')
},
{
......
......@@ -263,7 +263,9 @@ export default {
break
case 'list':
console.log('list', scope)
this.$router.push({ name: 'dictionaryData', params: { row: scope } })
const listData = { row: scope };
localStorage.setItem('dictionaryParams', listData);
this.$router.push({ name: 'dictionaryData', params: listData });
break
}
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!