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: { actions: {
hide() { hide() {
this.loading = false; this.loading = false;
let spins = document.querySelector('.ant-spin-nested-loading'); // 安全的DOM操作避免null引用错误
spins.style.zIndex = 999; try {
const spins = document.querySelector('.ant-spin-nested-loading');
if (spins) {
spins.style.zIndex = '999';
}
} catch (error) {
console.warn('Spin hide操作失败:', error);
}
}, },
show() { show() {
this.loading = true; this.loading = true;
let spins = document.querySelector('.ant-spin-nested-loading'); // 安全的DOM操作避免null引用错误
spins.style.zIndex = 1001; try {
const spins = document.querySelector('.ant-spin-nested-loading');
if (spins) {
spins.style.zIndex = '1001';
}
} catch (error) {
console.warn('Spin show操作失败:', error);
}
}, },
}, },
}); });