宠物主题切换

This commit is contained in:
tangly1024.com
2024-01-31 14:36:35 +08:00
parent 5082783dbd
commit 46aed51811
3 changed files with 11 additions and 10 deletions

View File

@@ -14,13 +14,13 @@ export const { THEMES = [] } = getConfig().publicRuntimeConfig
* @returns
*/
export const getGlobalLayoutByTheme = (themeQuery) => {
const layout = getLayoutNameByPath(-1)
if (themeQuery !== BLOG.THEME) {
return dynamic(() => import(`@/themes/${themeQuery}`).then(m => m[layout]), { ssr: true })
} else {
return ThemeComponents[layout]
}
const layout = getLayoutNameByPath(-1)
if (themeQuery !== BLOG.THEME) {
return dynamic(() => import(`@/themes/${themeQuery}`).then(m => m[layout]), { ssr: true })
} else {
return ThemeComponents[layout]
}
}
/**
* 加载主题文件
@@ -71,7 +71,7 @@ const checkThemeDOM = () => {
export const getLayoutNameByPath = (path) => {
switch (path) {
case -1:
return 'LayoutBase'
return 'LayoutBase'
case '/':
return 'LayoutIndex'
case '/archive':