12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- import type { App } from "vue";
- import Storage from "responsive-storage";
- import { routerArrays } from "@/layout/types";
- import { responsiveStorageNameSpace } from "@/config";
- export const injectResponsiveStorage = (app: App, config: PlatformConfigs) => {
- const nameSpace = responsiveStorageNameSpace();
- const configObj = Object.assign(
- {
-
- layout: Storage.getData("layout", nameSpace) ?? {
-
- layout: config.Layout ?? "mix",
- theme: config.Theme ?? "light",
- darkMode: config.DarkMode ?? false,
- sidebarStatus: config.SidebarStatus ?? true,
- epThemeColor: config.EpThemeColor ?? "#409EFF",
- themeColor: config.Theme ?? "light",
- overallStyle: config.OverallStyle ?? "light"
- },
-
- configure: Storage.getData("configure", nameSpace) ?? {
- grey: config.Grey ?? false,
- weak: config.Weak ?? false,
- hideTabs: config.HideTabs ?? false,
- hideFooter: config.HideFooter ?? true,
- showLogo: config.ShowLogo ?? true,
- showModel: config.ShowModel ?? "smart",
- multiTagsCache: config.MultiTagsCache ?? false,
- stretch: config.Stretch ?? false
- }
- },
- config.MultiTagsCache
- ? {
-
- tags: Storage.getData("tags", nameSpace) ?? routerArrays
- }
- : {}
- );
- app.use(Storage, { nameSpace, memory: configObj });
- };
|