Commit e15272be authored by Anatoly Kolesov's avatar Anatoly Kolesov Committed by 杨奕

fix show loading, leak memory (#9189)

* fix show loading, leak memory

* $on -> $once

* refresh Trv

* remove space
parent b10ecc94
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment