]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
chore: add getter double in playground demo-counter (#2625)
authorCaichong <951412526@qq.com>
Tue, 2 Apr 2024 13:37:13 +0000 (21:37 +0800)
committerGitHub <noreply@github.com>
Tue, 2 Apr 2024 13:37:13 +0000 (15:37 +0200)
packages/playground/src/stores/demo-counter.ts

index a2a39a6ed96980d4bbc1779bd8089290b4c8bd92..4db6edeae97af715cfae4da5a4dda402e1587956 100644 (file)
@@ -8,6 +8,9 @@ export const useCounter = defineStore('demo-counter', {
   state: () => ({
     n: 0,
   }),
+  getters: {
+    double: (state) => state.n * 2,
+  },
 })
 
 if (import.meta.hot) {