dev-audioprocessing/stores/counter.js

16 lines
339 B
JavaScript
Raw Normal View History

2023-01-01 03:17:42 +00:00
// stores/counter.js
import { defineStore } from 'pinia'
export const useCounterStore = defineStore('counter', {
state: () => {
2023-01-01 18:33:52 +00:00
return { count: 20 }
2023-01-01 03:17:42 +00:00
},
// could also be defined as
// state: () => ({ count: 0 })
actions: {
2023-01-01 18:33:52 +00:00
increment(a) {
this.count=a;
2023-01-01 03:17:42 +00:00
},
},
persist: true,
})