| | |
| | | <div class="titles">您的位置:</div> |
| | | <!-- <button @click="cc">cccc</button> --> |
| | | <!-- <el-breadcrumb-item style="position: relative;top: -3px;left: 5px">您的位置:</el-breadcrumb-item> --> |
| | | <el-breadcrumb separator="/"> |
| | | <!-- <el-breadcrumb-item v-show="!onceRouter" :to="{ path: '/wel/index' }">首页</el-breadcrumb-item> --> |
| | | <!-- <el-breadcrumb-item v-show="!onceRouter" :to="{ path: '/wel/index' }">首页</el-breadcrumb-item> --> |
| | | <!-- <el-breadcrumb separator="/"> |
| | | <el-breadcrumb-item |
| | | :to="item.path" |
| | | v-for="item of breadListLast" |
| | | :key="item.path" |
| | | style="border: hotpink 1px solid" |
| | | > |
| | | {{ item.name }} |
| | | </el-breadcrumb-item> |
| | | </el-breadcrumb> |
| | | </el-breadcrumb> --> |
| | | <div |
| | | class="ourCrumbsl" |
| | | v-for="(item, index) of breadListLast" |
| | | :key="item.path" |
| | | > |
| | | <div class="aaa" v-show="breadListLast.length != index + 1"> |
| | | <a href="javascript:;" @click="$router.push({ path: item.path})">{{ item.name }}</a> /  |
| | | </div> |
| | | <div class="bbb" v-show="breadListLast.length == index + 1"> |
| | | <div>{{ item.name }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- <router-view></router-view> --> |
| | | </div> |
| | |
| | | methods: { |
| | | loadChange(states) { |
| | | //导航栏进就是一级路由,其他页面push |
| | | if (this.isrf) {//刷新读取localStorage |
| | | 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 (n == "首页") { |
| | | n = "数据模式"; |
| | | } |
| | | if (ourP[os].name == n && os != ourP.length - 1) { |
| | | this.breadListLast.splice( |
| | |
| | | } |
| | | } |
| | | // console.log(p, n, "写入多级面包屑"); |
| | | |
| | | } |
| | | this.sOld = s; |
| | | // window.localStorage.crumbsl = this.breadListLast; |
| | | localStorage.setItem("crumbsl", JSON.stringify(this.breadListLast)); |
| | | |
| | | } |
| | | }, |
| | | loadChange2(states) { |
| | |
| | | console.log("首次被加载"); |
| | | window.name = "isReload"; // 在首次进入页面时我们可以给window.name设置一个固定值 |
| | | } else if (window.name == "isReload") { |
| | | this.isrf = true; |
| | | console.log("页面被刷新"); |
| | | var abb = localStorage.getItem("crumbsl"); |
| | | if (abb) { |
| | | this.isrf = true; |
| | | console.log("页面被刷新"); |
| | | } else { |
| | | this.isrf = false; |
| | | console.log("页面被刷新,但后台没有数据"); |
| | | } |
| | | |
| | | } |
| | | this.loadChange("moun"); |
| | | }, |
| | |
| | | background: #fff; |
| | | .titles { |
| | | position: absolute; |
| | | top: 17px; |
| | | top: 17.15px; |
| | | left: 5px; |
| | | font-weight: 400; |
| | | } |
| | | .ourCrumbsl { |
| | | // border: hotpink 1px solid; |
| | | float: left; |
| | | font-weight: 400; |
| | | position: relative; |
| | | top: -3px; |
| | | a{ |
| | | font-weight: 400; |
| | | } |
| | | } |
| | | } |
| | | } |