Browse Source

修改侧边导航跳转携带参数问题

pull/63/head
zq 6 days ago
parent
commit
8204086f1e
  1. 1
      src/assets/menu/channel.svg
  2. 31
      src/components/SetLeftMenu.vue
  3. 18
      src/store/index.js

1
src/assets/menu/channel.svg

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 6.4 KiB

31
src/components/SetLeftMenu.vue

@ -151,25 +151,34 @@ export default {
let path = item.path; let path = item.path;
if (!path) { if (!path) {
this.curIndex = index; this.curIndex = index;
return return;
} }
if (this.$route.path != path) { if (this.$route.path != path) {
this.curIndex = index this.curIndex = index;
this.scrollLock = false; this.scrollLock = false;
this.handleScroll() this.handleScroll();
//
this.$router.push({
path: path,
query: { ...this.$route.query }, //
params: { ...this.$route.params } //
});
// //
const dom = document.getElementById('main-content') const dom = document.getElementById('main-content');
dom.scrollTop = 0; if (dom) dom.scrollTop = 0;
this.$router.push(path)
} }
}, },
activeArea(type) {
console.log(type);
},
setActiveCur(dom, item) { setActiveCur(dom, item) {
debugger
if (this.$route.path !== item.path) { if (this.$route.path !== item.path) {
this.$router.push(item.path); //
this.$router.push({
path: item.path,
query: { ...this.$route.query }, //
params: { ...this.$route.params } //
});
store.commit('SET_PAGETITLE', item.name); store.commit('SET_PAGETITLE', item.name);
} }

18
src/store/index.js

@ -106,13 +106,9 @@ export default new Vuex.Store({
index: '2', index: '2',
title: '订单列表', title: '订单列表',
icon: 'orderList', icon: 'orderList',
children: [{ children: [
index: '2-1',
title: '站点列表',
path: '/agent/siteList'
},
{ {
index: '2-2', index: '2-1',
title: 'ui页面', title: 'ui页面',
path: '/ui' path: '/ui'
} }
@ -120,12 +116,12 @@ export default new Vuex.Store({
}, },
{ {
index: '3', index: '3',
title: '父级菜单2', title: '销售渠道',
icon: 'Totalprofit', icon: 'channel',
children: [{ children: [{
index: '3-1', index: '3-1',
title: '子级菜单3-1', title: '站点列表',
path: '/about' path: '/agent/siteList'
}, },
{ {
index: '3-2', index: '3-2',
@ -139,7 +135,7 @@ export default new Vuex.Store({
title: '财务', title: '财务',
icon: 'Totalprofit', icon: 'Totalprofit',
children: [{ children: [{
index: '3-1', index: '4-1',
title: '收款方式', title: '收款方式',
path: '/agent/payList' path: '/agent/payList'
}, },

Loading…
Cancel
Save