xyyd-fatfox/src/layout/useLayoutStore.ts

31 lines
516 B
TypeScript
Raw Normal View History

2024-09-09 17:53:07 +08:00
import { useForageStore } from '@/db'
import { defineStore } from 'pinia'
import type { Layout } from './layout.types'
const defaultLayout: Layout = {
content: [[], [], []],
current: 0,
currentPage: 0,
dir: {},
dock: {
q: null,
w: null,
e: null,
r: null,
a: null,
s: null,
d: null,
f: null,
b: null
},
simple: false,
loading: true
}
export default defineStore('layout', () => {
const state = useForageStore('layout', defaultLayout)
return {
state
}
})