Przeglądaj źródła

change page handle vuex state

Unknown 7 lat temu
rodzic
commit
b009d251ab
1 zmienionych plików z 28 dodań i 2 usunięć
  1. 28 2
      src/store/modules/breadcrumb.js

+ 28 - 2
src/store/modules/breadcrumb.js

@@ -1,10 +1,36 @@
1 1
 const breadcrumb = {
2 2
   state: {
3
-    visible: true
3
+    visible: {
4
+      firstLayer: true,
5
+      secondLayer: false,
6
+      thridLayer: false
7
+    }
4 8
   },
5 9
   mutations: {
6 10
     SET_VISIBLE: (state, visible) => {
7
-      state.visible = visible
11
+      switch (visible) {
12
+        case 1:
13
+          state.visible = {
14
+            firstLayer: true,
15
+            secondLayer: false,
16
+            thridLayer: false
17
+          }
18
+          break
19
+        case 2:
20
+          state.visible = {
21
+            firstLayer: false,
22
+            secondLayer: true,
23
+            thridLayer: false
24
+          }
25
+          break
26
+        case 3:
27
+          state.visible = {
28
+            firstLayer: false,
29
+            secondLayer: false,
30
+            thridLayer: true
31
+          }
32
+          break
33
+      }
8 34
     }
9 35
   },
10 36
   actions: {