Skip to content

Commit

Permalink
fix: 动画 done 执行时机调整
Browse files Browse the repository at this point in the history
  • Loading branch information
0x30 committed Jan 4, 2024
1 parent 4cc3f3d commit 2f6465f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/core/src/manage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,18 +130,24 @@ const mounted = (compoent: VNode, replace: boolean, hooks?: LifeCycleHooks) => {
/// 执行 进入动画
const from = getChildren(lastAppContext.app._container)
await execEnterAnimator(target?.appContext, from, el)
done()

replaceDone()
resolve(app)

/// 在处理完 替换done事件后,再处理动画完成
done()
}}
onLeave={async (el, done) => {
disableBodyPointerEvents()
const to = getChildren(getLastApp()._container)
/// 执行 退出动画
await execLeaveAnimator(target?.appContext, el, to)
done()

if (closeDone) closeDone()
else enableBodyPointerEvents()

/// 在处理完成 close done 事件后,再处理动画完成
done()
}}
onBeforeEnter={(el) => {
onBeforeEnter?.(el)
Expand Down

0 comments on commit 2f6465f

Please sign in to comment.