fix: 修复 eslint 报错

This commit is contained in:
LooseLi
2025-05-26 18:11:45 +08:00
parent 1f691818f8
commit 3366dd4a6c
7 changed files with 108 additions and 103 deletions

View File

@@ -79,17 +79,17 @@ export const getBaseLayoutByTheme = theme => {
*/
export const DynamicLayout = props => {
const { theme, layoutName } = props
const SelectedLayout = getLayoutByTheme({ layoutName, theme })
const SelectedLayout = useLayoutByTheme({ layoutName, theme })
return <SelectedLayout {...props} />
}
/**
* 加载主题文件
* @param {*} router
* @param {*} layoutName
* @param {*} theme
* @returns
*/
export const getLayoutByTheme = ({ layoutName, theme }) => {
export const useLayoutByTheme = ({ layoutName, theme }) => {
// const layoutName = getLayoutNameByPath(router.pathname, router.asPath)
const LayoutComponents =
ThemeComponents[layoutName] || ThemeComponents.LayoutSlug