31 lines
516 B
TypeScript
31 lines
516 B
TypeScript
|
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
|
||
|
}
|
||
|
})
|