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;
if (!path) {
this.curIndex = index;
return
return;
}
if (this.$route.path != path) {
this.curIndex = index
this.curIndex = index;
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')
dom.scrollTop = 0;
this.$router.push(path)
const dom = document.getElementById('main-content');
if (dom) dom.scrollTop = 0;
}
},
activeArea(type) {
console.log(type);
},
setActiveCur(dom, item) {
debugger
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);
}

18
src/store/index.js

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

Loading…
Cancel
Save