fix(components): [loading] remove el-loading-parent--relative correctly (#9630)

* fix(components): [loading] fix el-loading-parent--relative (#9627)

* chore: update

Co-authored-by: holazz <2418184580@qq.com>
This commit is contained in:
小的的 2022-09-05 23:51:17 -05:00 committed by GitHub
parent dee98ed32a
commit 69caee0d2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -54,17 +54,10 @@ export function createLoadingComponent(options: LoadingOptionsResolved) {
function close() {
if (options.beforeClose && !options.beforeClose()) return
const target = data.parent
target.vLoadingAddClassList = undefined
afterLeaveFlag.value = true
clearTimeout(afterLeaveTimer)
afterLeaveTimer = window.setTimeout(() => {
if (afterLeaveFlag.value) {
afterLeaveFlag.value = false
destroySelf()
}
}, 400)
afterLeaveTimer = window.setTimeout(handleAfterLeave, 400)
data.visible = false
options.closed?.()
@ -72,7 +65,9 @@ export function createLoadingComponent(options: LoadingOptionsResolved) {
function handleAfterLeave() {
if (!afterLeaveFlag.value) return
const target = data.parent
afterLeaveFlag.value = false
target.vLoadingAddClassList = undefined
destroySelf()
}