mirror of
https://github.com/1024-lab/smart-admin.git
synced 2026-06-02 03:55:59 +00:00
Update spin.js
修复菜单切换卡死问题;
This commit is contained in:
@@ -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);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user