From 3eced65b14a858329fd2b7f4c8bc6c5d66710c78 Mon Sep 17 00:00:00 2001
From: wu <731351411@qq.com>
Date: 星期三, 06 九月 2023 16:57:01 +0800
Subject: [PATCH] Merge branch 'master' of ssh://10.153.19.150:29418/CanadaMes

---
 CanadaMes-ui/src/store/module/tags.js |   21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/CanadaMes-ui/src/store/module/tags.js b/CanadaMes-ui/src/store/module/tags.js
index 3e3b974..a16623a 100644
--- a/CanadaMes-ui/src/store/module/tags.js
+++ b/CanadaMes-ui/src/store/module/tags.js
@@ -1,6 +1,6 @@
 const state = {
   tags: []
-};
+}
 
 const mutations = {
   addTag(state, tag) {
@@ -8,15 +8,20 @@
       state.tags.push(tag);
     }
   },
-  removeTag(state, tag) {
-    const index = state.tags.indexOf(tag);
-    if (index !== -1) {
-      state.tags.splice(index, 1);
-    }
+  removeTag(state, index) {
+    state.tags.splice(index, 1);
+  },
+  removeAllTags(state) {
+    state.tags = [];
+  },
+  switchTag(tag) {
+    this.$emit('switchTag', tag);
+    this.$router.push('/' + tag); // 娣诲姞杩欒浠g爜浠ュ垏鎹㈣矾鐢�
   }
-};
+}
 
 export default {
+  namespaced: true,
   state,
   mutations
-};
\ No newline at end of file
+}

--
Gitblit v1.8.0