refactor: move composables/stores/plugins back to project root for Nuxt auto-imports
This commit is contained in:
parent
e1daaede27
commit
bc2babbe90
5 changed files with 8 additions and 10 deletions
18
stores/counter.ts
Normal file
18
stores/counter.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import { defineStore } from "pinia";
|
||||
|
||||
export const useCounterStore = defineStore("counter", {
|
||||
state: () => ({
|
||||
count: 0,
|
||||
}),
|
||||
getters: {
|
||||
doubleCount: (state) => state.count * 2,
|
||||
},
|
||||
actions: {
|
||||
increment() {
|
||||
this.count += 1;
|
||||
},
|
||||
},
|
||||
persist: {
|
||||
paths: ["count"],
|
||||
},
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue