18 lines
224 B
JavaScript
18 lines
224 B
JavaScript
|
|
import {
|
||
|
|
defineStore
|
||
|
|
} from 'pinia';
|
||
|
|
|
||
|
|
export const useTestStore = defineStore({
|
||
|
|
id: ' test',
|
||
|
|
state: () => ({
|
||
|
|
count: 0,
|
||
|
|
}),
|
||
|
|
actions: {
|
||
|
|
increment() {
|
||
|
|
this.count++;
|
||
|
|
},
|
||
|
|
decrement() {
|
||
|
|
this.count--;
|
||
|
|
},
|
||
|
|
},
|
||
|
|
});
|