| | |
| | | methods: { |
| | | loadChange(states) { |
| | | //导航栏进就是一级路由,其他页面push |
| | | if (this.isrf) { |
| | | if (this.isrf) {//刷新读取localStorage |
| | | this.breadListLast = JSON.parse(localStorage.getItem("crumbsl")); |
| | | } else { |
| | | } else {//关闭重写 |
| | | var path = this.$route.path, |
| | | p = path.split("/").pop(), |
| | | n = this.$route.name, |
| | |
| | | //判断是否有重复项,有则删除其后路由↓ |
| | | var ourP = this.breadListLast; |
| | | for (var os in ourP) { |
| | | if(n == '首页'){ |
| | | n = '数据模式' |
| | | } |
| | | if (ourP[os].name == n && os != ourP.length - 1) { |
| | | this.breadListLast.splice( |
| | | +os + 1, |
| | | this.breadListLast.length - os - 1 |
| | | ); |
| | | // console.log(+os + 1, ourP[os].name, "删除重复面包屑"); |
| | | } |
| | | } |
| | | // console.log(p, n, "写入多级面包屑"); |