面包屑跳转

master
wyj2080 6 years ago
parent b321a97617
commit 185e7800e9

@ -28,3 +28,10 @@ new Vue({
}).$mount('#app')
//重复点击同一个报错解决
import Router from 'vue-router'
const routerPush = Router.prototype.push
Router.prototype.push = function push(location) {
return routerPush.call(this, location).catch(error=> error)
}

@ -143,6 +143,7 @@
import customerView from "../services/datacenter/customerView";
export default {
inject:['setMenuName'],
data() {
return {
userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId,
@ -362,6 +363,7 @@
},
//广
zeroExtendMore: function () {
this.setMenuName("首页","推广为0店铺数");
let that = this;
this.$router.push({
path: '/zero/extend/detail',

@ -31,7 +31,7 @@
<!-- <Header :style="{background: '#fff', boxShadow: '0 2px 3px 2px rgba(0,0,0,.1)'}"></Header>-->
<Content :style="{padding: '0 16px 16px'}">
<Breadcrumb :style="{margin: '16px 0'}">
<BreadcrumbItem>{{selectedMenu}}</BreadcrumbItem>
<BreadcrumbItem><span style="cursor: pointer" @click="breadcrumbClick">{{selectedMenu}}</span></BreadcrumbItem>
<BreadcrumbItem>{{selectedSubMenu}}</BreadcrumbItem>
</Breadcrumb>
<Card>
@ -51,10 +51,12 @@
provide() {
return {
checkParamBlank: this.checkParamBlank,
setMenuName: this.setMenuName,
};
},
data() {
return {
mainUrl: "/customer/view",
isCollapsed: false,
mHeight: 600,
selectedItemName: null,
@ -71,6 +73,8 @@
twoPermissionList: [],
//3
threePermissionList: [],
//
breadcrumbUrl: "",
}
},
mounted() {
@ -127,6 +131,7 @@
if (cItem.id === val) {
this.selectedMenu = item.name;
this.selectedSubMenu = cItem.name;
this.breadcrumbUrl = cItem.resource;
}
}
}
@ -239,12 +244,14 @@
}
})
},
//
//
menuInit: function () {
let that = this;
//
that.selectedItemName = 0;
this.$router.push({path: "/customer/view"});
this.$router.push({path: that.mainUrl});
this.selectedMenu = "首页";
this.breadcrumbUrl = this.mainUrl;
// that.selectedItemName = that.onePermissionList[0].subMenuList[0].id;
// that.openName = [that.onePermissionList[0].id];
// this.$nextTick(() => {
@ -273,6 +280,18 @@
this.$nextTick(() => {
that.$refs.menu.updateActiveName();
})
},
//
setMenuName: function (menu1, menu2) {
this.selectedMenu = menu1;
this.selectedSubMenu = menu2;
},
//
breadcrumbClick: function () {
if(this.selectedMenu === "首页"){
this.selectedSubMenu = "";
}
this.$router.push(this.breadcrumbUrl);
}
},

Loading…
Cancel
Save