renderer: add counter example

This commit is contained in:
leejooy96 committed 2022-10-19 08:12:27 +09:00
1 parent a51944e550
commit 4cf61b031a
2 files changed
+19 -7

No files matched your search

+4 -4
View File
@@ -2,14 +2,14 @@ import { defineStore } from 'pinia'
export const useTempStore = defineStore('temp', {
state: () => ({
text: 'Sample Text'
counter: 0
}),
getters: {
getText: (state) => state.text
getCounter: (state): number => state.counter
},
actions: {
setText(text) {
this.text = text
counterIncrease(amount: number) {
this.counter += amount
}
}
})