mirror of
https://github.com/1024-lab/smart-admin.git
synced 2026-01-14 06:03:58 +08:00
@@ -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);
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user