guhongwei 1 年間 前
コミット
b1a5e181b5
1 ファイル変更9 行追加10 行削除
  1. 9 10
      src/stores/counter.ts

+ 9 - 10
src/stores/counter.ts

@@ -1,12 +1,11 @@
-import { ref, computed } from 'vue'
-import { defineStore } from 'pinia'
+import * as ustate from './user/state'
+import * as umutations from './user/mutations'
 
-export const useCounterStore = defineStore('counter', () => {
-  const count = ref(0)
-  const doubleCount = computed(() => count.value * 2)
-  function increment() {
-    count.value++
-  }
-
-  return { count, doubleCount, increment }
+import { createStore } from 'vuex'
+const store = createStore({
+  state: { ...ustate },
+  mutations: { ...umutations },
+  actions: {},
+  modules: {}
 })
+export default store