refactor: refacotr preference
This commit is contained in:
13
apps/antd-view/src/store/modules/example.ts
Normal file
13
apps/antd-view/src/store/modules/example.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { defineStore } from 'pinia';
|
||||
|
||||
export const useCounterStore = defineStore('counter', {
|
||||
actions: {
|
||||
increment() {
|
||||
this.count++;
|
||||
},
|
||||
},
|
||||
getters: {
|
||||
double: (state) => state.count * 2,
|
||||
},
|
||||
state: () => ({ count: 0 }),
|
||||
});
|
Reference in New Issue
Block a user