chore: align srcDir=app structure (assets, composables, stores, plugins, pages) and prepare for correct alias resolution
This commit is contained in:
parent
bc2babbe90
commit
9a04893909
8 changed files with 10 additions and 10 deletions
|
|
@ -1,25 +0,0 @@
|
|||
import { useCounterStore } from '~/stores/counter'
|
||||
|
||||
export type AppSnapshot = {
|
||||
counter: { count: number }
|
||||
}
|
||||
|
||||
export function useFixtureIO() {
|
||||
const exportAll = (): AppSnapshot => {
|
||||
const counter = useCounterStore()
|
||||
return {
|
||||
counter: { count: counter.count }
|
||||
}
|
||||
}
|
||||
|
||||
const importAll = (snapshot: AppSnapshot) => {
|
||||
const counter = useCounterStore()
|
||||
if (snapshot?.counter) {
|
||||
counter.$patch({ count: snapshot.counter.count ?? 0 })
|
||||
}
|
||||
}
|
||||
|
||||
return { exportAll, importAll }
|
||||
}
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue