wangxy 3 月之前
父节点
当前提交
81df52436e
共有 1 个文件被更改,包括 12 次插入0 次删除
  1. 12 0
      store/counter.js

+ 12 - 0
store/counter.js

@@ -0,0 +1,12 @@
+import { defineStore } from 'pinia';
+
+export const useCounterStore = defineStore('counter', {
+	state: () => {
+		return { count: 0 };
+	},
+	actions: {
+		increment() {
+			this.count++;
+		},
+	},
+});