提交
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { defineStore } from 'pinia'
|
||||
export const useCounterStore = defineStore('counter', {
|
||||
state: () => ({
|
||||
count: 0
|
||||
}),
|
||||
getters: {
|
||||
doubleCount: (state) => state.count * 2
|
||||
},
|
||||
actions: {
|
||||
increment() {
|
||||
this.count++
|
||||
},
|
||||
decrement() {
|
||||
this.count--
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user