Merge pull request #87 from BeeThor/master

Update spin.js
This commit is contained in:
1024创新实验室
2025-08-24 20:32:54 +08:00
committed by GitHub

View File

@@ -18,13 +18,27 @@ export const useSpinStore = defineStore({
actions: {
hide() {
this.loading = false;
let spins = document.querySelector('.ant-spin-nested-loading');
spins.style.zIndex = 999;
// 安全的DOM操作避免null引用错误
try {
const spins = document.querySelector('.ant-spin-nested-loading');
if (spins) {
spins.style.zIndex = '999';
}
} catch (error) {
console.warn('Spin hide操作失败:', error);
}
},
show() {
this.loading = true;
let spins = document.querySelector('.ant-spin-nested-loading');
spins.style.zIndex = 1001;
// 安全的DOM操作避免null引用错误
try {
const spins = document.querySelector('.ant-spin-nested-loading');
if (spins) {
spins.style.zIndex = '1001';
}
} catch (error) {
console.warn('Spin show操作失败:', error);
}
},
},
});