mirror of
https://github.com/pure-admin/pure-admin-thin.git
synced 2025-11-17 16:13:40 +08:00
release: update 3.4.5
This commit is contained in:
41
src/utils/responsive.ts
Normal file
41
src/utils/responsive.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
// 响应式storage
|
||||
import { App } from "vue";
|
||||
import Storage from "responsive-storage";
|
||||
import { routerArrays } from "/@/layout/types";
|
||||
|
||||
const nameSpace = "responsive-";
|
||||
|
||||
export const injectResponsiveStorage = (app: App, config: ServerConfigs) => {
|
||||
const configObj = Object.assign(
|
||||
{
|
||||
// 国际化 默认中文zh
|
||||
locale: Storage.getData("locale", nameSpace) ?? {
|
||||
locale: config.Locale ?? "zh"
|
||||
},
|
||||
// layout模式以及主题
|
||||
layout: Storage.getData("layout", nameSpace) ?? {
|
||||
layout: config.Layout ?? "vertical",
|
||||
theme: config.Theme ?? "default",
|
||||
darkMode: config.DarkMode ?? false,
|
||||
sidebarStatus: config.SidebarStatus ?? true,
|
||||
epThemeColor: config.EpThemeColor ?? "#409EFF"
|
||||
},
|
||||
configure: Storage.getData("configure", nameSpace) ?? {
|
||||
grey: config.Grey ?? false,
|
||||
weak: config.Weak ?? false,
|
||||
hideTabs: config.HideTabs ?? false,
|
||||
showLogo: config.ShowLogo ?? true,
|
||||
showModel: config.ShowModel ?? "smart",
|
||||
multiTagsCache: config.MultiTagsCache ?? false
|
||||
}
|
||||
},
|
||||
config.MultiTagsCache
|
||||
? {
|
||||
// 默认显示首页tag
|
||||
tags: Storage.getData("tags", nameSpace) ?? routerArrays
|
||||
}
|
||||
: {}
|
||||
);
|
||||
|
||||
app.use(Storage, { nameSpace, memory: configObj });
|
||||
};
|
||||
Reference in New Issue
Block a user