优化加载动画逻辑

This commit is contained in:
jxxghp
2025-07-04 21:26:44 +08:00
parent bb70e91277
commit e2b789cfbc
2 changed files with 2 additions and 9 deletions

View File

@@ -123,14 +123,8 @@ function startBackgroundRotation() {
function animateAndRemoveLoader() {
const loadingBg = document.querySelector('#loading-bg') as HTMLElement
if (loadingBg) {
// 先添加完成动画类
loadingBg.classList.add('loading-complete')
// 等待动画完成后再移除元素
setTimeout(() => {
removeEl('#loading-bg')
// 将background属性从html的style中移除
document.documentElement.style.removeProperty('background')
}, 500)
removeEl('#loading-bg')
document.documentElement.style.removeProperty('background')
}
}

View File

@@ -45,7 +45,6 @@ export const useGlobalSettingsStore = defineStore('globalSettings', {
isInitialized: state => state.initialized,
isLoading: state => state.loading,
getData: state => state.data,
// 直接返回data对象避免使用.value
globalSettings: state => state.data,
},
})