From e2ed7cb4ef578d970beca80aea4903e9b13cd1f8 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 23 Apr 2021 17:21:40 +0800
Subject: [PATCH] Merge branch 'master' of http://s16s652780.51mypc.cn:49896/r/jfpt-Vue

---
 src/page/crumbsL/crumbsL.vue |   55 ++++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 44 insertions(+), 11 deletions(-)

diff --git a/src/page/crumbsL/crumbsL.vue b/src/page/crumbsL/crumbsL.vue
index d2c5fac..a6c9b2c 100644
--- a/src/page/crumbsL/crumbsL.vue
+++ b/src/page/crumbsL/crumbsL.vue
@@ -4,16 +4,29 @@
       <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>&nbsp/&nbsp
+      </div>
+      <div class="bbb" v-show="breadListLast.length == index + 1">
+        <div>{{ item.name }}</div>
+      </div>
+      </div>
     </div>
     <!-- <router-view></router-view> -->
   </div>
@@ -64,9 +77,11 @@
   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,
@@ -92,8 +107,8 @@
           //判断是否有重复项,有则删除其后路由↓
           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(
@@ -104,11 +119,11 @@
             }
           }
           // console.log(p, n, "写入多级面包屑");
-         
         }
         this.sOld = s;
         // window.localStorage.crumbsl = this.breadListLast;
         localStorage.setItem("crumbsl", JSON.stringify(this.breadListLast));
+
       }
     },
     loadChange2(states) {
@@ -285,8 +300,15 @@
       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");
   },
@@ -305,8 +327,19 @@
     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;
+      }
     }
   }
 }

--
Gitblit v1.9.3