Use vueuse useStorage instead of manually using localStorage

This commit is contained in:
2022-02-11 21:38:06 +00:00
parent 5868c3310e
commit 45389e01be
7 changed files with 27 additions and 60 deletions

View File

@@ -1,13 +1,14 @@
import { useStorage } from "@vueuse/core";
import { defineStore } from "pinia";
interface State {
ShowMenu?: boolean,
ExpandMenu?: boolean,
ShowMenu: boolean | null,
ExpandMenu: boolean,
}
export const useSettingsStore = defineStore('settings', {
state: (): State => ({
ShowMenu: undefined,
state: () => useStorage<State>('settings', {
ShowMenu: null,
ExpandMenu: false,
}),
actions: {