mirror of
https://gitee.com/ElemeFE/element.git
synced 2024-11-30 11:17:38 +08:00
fix show loading, leak memory (#9189)
* fix show loading, leak memory * $on -> $once * refresh Trv * remove space
This commit is contained in:
parent
b10ecc94ad
commit
e15272be56
@ -37,15 +37,17 @@ exports.install = Vue => {
|
||||
});
|
||||
} else {
|
||||
if (el.domVisible) {
|
||||
el.instance.$on('after-leave', _ => {
|
||||
el.instance.$once('after-leave', _ => {
|
||||
el.domVisible = false;
|
||||
const target = binding.modifiers.fullscreen || binding.modifiers.body
|
||||
? document.body
|
||||
: el;
|
||||
removeClass(target, 'el-loading-parent--relative');
|
||||
removeClass(target, 'el-loading-parent--hidden');
|
||||
el.instance.hiding = false;
|
||||
});
|
||||
el.instance.visible = false;
|
||||
el.instance.hiding = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -65,7 +67,11 @@ exports.install = Vue => {
|
||||
|
||||
parent.appendChild(el.mask);
|
||||
Vue.nextTick(() => {
|
||||
el.instance.visible = true;
|
||||
if (el.instance.hiding) {
|
||||
el.instance.$emit('after-leave');
|
||||
} else {
|
||||
el.instance.visible = true;
|
||||
};
|
||||
});
|
||||
el.domInserted = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user