ZengTao
2023-09-05 7870c2d4fd6da5269a87f53d584a36628fd8ef12
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
const state = {
  tags: []
};
 
const mutations = {
  addTag(state, tag) {
    if (!state.tags.includes(tag)) {
      state.tags.push(tag);
    }
  },
  removeTag(state, tag) {
    const index = state.tags.indexOf(tag);
    if (index !== -1) {
      state.tags.splice(index, 1);
    }
  }
};
 
export default {
  state,
  mutations
};