优化加载动画逻辑

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
+2 -8
View File
@@ -123,14 +123,8 @@ function startBackgroundRotation() {
function animateAndRemoveLoader() { function animateAndRemoveLoader() {
const loadingBg = document.querySelector('#loading-bg') as HTMLElement const loadingBg = document.querySelector('#loading-bg') as HTMLElement
if (loadingBg) { if (loadingBg) {
// 先添加完成动画类 removeEl('#loading-bg')
loadingBg.classList.add('loading-complete') document.documentElement.style.removeProperty('background')
// 等待动画完成后再移除元素
setTimeout(() => {
removeEl('#loading-bg')
// 将background属性从html的style中移除
document.documentElement.style.removeProperty('background')
}, 500)
} }
} }
-1
View File
@@ -45,7 +45,6 @@ export const useGlobalSettingsStore = defineStore('globalSettings', {
isInitialized: state => state.initialized, isInitialized: state => state.initialized,
isLoading: state => state.loading, isLoading: state => state.loading,
getData: state => state.data, getData: state => state.data,
// 直接返回data对象,避免使用.value
globalSettings: state => state.data, globalSettings: state => state.data,
}, },
}) })