renderer: add counter example
This commit is contained in:
1 parent
a51944e550
commit
4cf61b031a
2 files changed
+19
-7
No files matched your search
@@ -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
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in new issue
Block a user