mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-05 15:10:26 +00:00
部分参数配置化
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user