wucl 9 месяцев назад
Родитель
Сommit
699b3f5199
2 измененных файлов с 18 добавлено и 1 удалено
  1. 6 1
      src/components/Breadcrumb/index.vue
  2. 12 0
      src/router/index.js

+ 6 - 1
src/components/Breadcrumb/index.vue

@@ -4,7 +4,7 @@
       <el-breadcrumb-item v-for="(item, index) in breadcrumbData" :key="index + 'id'">
         <span v-if="index === breadcrumbData.length - 1" class="no-redirect" style="color:black">{{ item.meta.title
           }}</span>
-        <span v-else class="no-redirect">{{ item.meta.title }}</span>
+        <span v-else class="no-redirect" @click="goTo(item.path)">{{ item.meta.title }}</span>
       </el-breadcrumb-item>
     </transition-group>
   </el-breadcrumb>
@@ -61,4 +61,9 @@
   .breadcrumb{
     margin-bottom: 20px;
   }
+
+  .no-redirect:hover{
+    cursor: pointer;
+    color: #ff6154;;
+  }
 </style>

+ 12 - 0
src/router/index.js

@@ -21,6 +21,18 @@ const routes = [
     redirect:'/home/index'
   },
   {
+    path:'/home',
+    redirect:'/home/index'
+  },
+  {
+    path:'/home/house',
+    redirect:'/home/house/parent'
+  },
+  {
+    path:'/home/houseWorkbench',
+    redirect:'/home/house/parent'
+  },
+  {
     path: '/home',
     component: Layout,
     name: 'home',