yangc 8 жил өмнө
parent
commit
93497c4636

+ 11 - 0
store/loading.js

@@ -0,0 +1,11 @@
+export const actions = {
+// 搜索请求
+  setCount ({ commit }, params = {}) {
+    if (params.count) {
+      commit('searchCount/SET_COUNT_ADD')
+    } else {
+      commit('searchCount/SET_COUNT')
+    }
+  }
+}
+

+ 13 - 0
store/loading/searchCount.js

@@ -0,0 +1,13 @@
+export const state = () => ({
+  count: 0
+})
+
+export const mutations = {
+  SET_COUNT_ADD (state) {
+    state.count ++
+  },
+  SET_COUNT (state, result) {
+    state.count = result
+  }
+}
+