admin-vben/apps/web-antd/src/store/modules/example.ts

15 lines
265 B
TypeScript

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