部分参数配置化

This commit is contained in:
tangly1024.com
2023-11-03 17:10:59 +08:00
parent 545c071f81
commit f145d8b28c
23 changed files with 267 additions and 208 deletions

View File

@@ -44,7 +44,6 @@ const MyApp = ({ Component, pageProps }) => {
loadExternalResource(url, 'css')
}
}
checkThemeDOM()
}
return (
@@ -55,18 +54,4 @@ const MyApp = ({ Component, pageProps }) => {
)
}
/**
* 切换主题时的特殊处理
*/
const checkThemeDOM = () => {
const elements = document.querySelectorAll('[id^="theme-"]')
if (elements?.length > 1) {
elements[elements.length - 1].scrollIntoView()
// 删除前面的元素,只保留最后一个元素
for (let i = 0; i < elements.length - 1; i++) {
elements[i].parentNode.removeChild(elements[i])
}
}
}
export default MyApp