After
Width: | Height: | Size: 6.4 KiB
@ -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.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);
path: item.path,
store.commit('SET_PAGETITLE', item.name);
@ -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',
title: 'ui页面',
path: '/ui'
@ -120,12 +116,12 @@ export default new Vuex.Store({
index: '3',
title: '父级菜单2',
icon: 'Totalprofit',
title: '销售渠道',
icon: 'channel',
index: '3-1',
title: '子级菜单3-1',
path: '/about'
index: '3-2',
@ -139,7 +135,7 @@ export default new Vuex.Store({
title: '财务',
index: '4-1',
title: '收款方式',
path: '/agent/payList'