mirror of
https://github.com/un-pany/v3-admin-vite.git
synced 2025-04-21 03:19:19 +08:00
perf: 代码优化 utils/cache
This commit is contained in:
parent
51916b6bc0
commit
bf29e0e52a
@ -1,5 +1,5 @@
|
||||
import { ref, watchEffect } from "vue"
|
||||
import { getActiveThemeName, setActiveThemeName } from "@/utils/cache/localStorage"
|
||||
import { getActiveThemeName, setActiveThemeName } from "@/utils/cache/local-storage"
|
||||
|
||||
const DEFAULT_THEME_NAME = "normal"
|
||||
type DefaultThemeName = typeof DEFAULT_THEME_NAME
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { reactive, ref, watch } from "vue"
|
||||
import { defineStore } from "pinia"
|
||||
import { getSidebarStatus, setSidebarStatus } from "@/utils/cache/localStorage"
|
||||
import { getSidebarStatus, setSidebarStatus } from "@/utils/cache/local-storage"
|
||||
import { DeviceEnum, SIDEBAR_OPENED, SIDEBAR_CLOSED } from "@/constants/app-key"
|
||||
|
||||
interface Sidebar {
|
||||
|
@ -12,7 +12,7 @@ export const setSidebarStatus = (sidebarStatus: SidebarOpened | SidebarClosed) =
|
||||
}
|
||||
|
||||
export const getActiveThemeName = () => {
|
||||
return localStorage.getItem(CacheKey.ACTIVE_THEME_NAME) as ThemeName
|
||||
return localStorage.getItem(CacheKey.ACTIVE_THEME_NAME) as ThemeName | null
|
||||
}
|
||||
export const setActiveThemeName = (themeName: ThemeName) => {
|
||||
localStorage.setItem(CacheKey.ACTIVE_THEME_NAME, themeName)
|
Loading…
x
Reference in New Issue
Block a user