重构优化主题异步加载

This commit is contained in:
tangly1024.com
2023-06-07 15:39:41 +08:00
parent 9247c4d308
commit 00d32c81e0
107 changed files with 467 additions and 338 deletions

View File

@@ -33,6 +33,8 @@ export function GlobalContextProvider({ children }) {
const handleBeforeUnload = (event) => {
setOnReading(true)
}
// 监听页面元素加载完
setOnReading(false)
window.addEventListener('beforeunload', handleBeforeUnload)
return () => {
window.removeEventListener('beforeunload', handleBeforeUnload)