14 lines
250 B
TypeScript
14 lines
250 B
TypeScript
![]() |
import { defineStore } from 'pinia';
|
||
|
|
||
|
export const useCounterStore = defineStore('counter', {
|
||
|
actions: {
|
||
|
increment() {
|
||
|
this.count++;
|
||
|
},
|
||
|
},
|
||
|
getters: {
|
||
|
double: (state) => state.count * 2,
|
||
|
},
|
||
|
state: () => ({ count: 0 }),
|
||
|
});
|