From: Elodie Hill <34654733+royalknight56@users.noreply.github.com> Date: Sun, 25 Feb 2024 13:14:46 +0000 (+0800) Subject: refactor(transition): remove unused getTransitionKey logic (#10283) X-Git-Tag: v3.4.20~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=edbbb6da1216f4de8f219ba81d4ac186ba139387;p=thirdparty%2Fvuejs%2Fcore.git refactor(transition): remove unused getTransitionKey logic (#10283) --- diff --git a/packages/runtime-core/src/components/BaseTransition.ts b/packages/runtime-core/src/components/BaseTransition.ts index 20da25848b..e99fe0e496 100644 --- a/packages/runtime-core/src/components/BaseTransition.ts +++ b/packages/runtime-core/src/components/BaseTransition.ts @@ -144,8 +144,6 @@ const BaseTransitionImpl: ComponentOptions = { const instance = getCurrentInstance()! const state = useTransitionState() - let prevTransitionKey: any - return () => { const children = slots.default && getTransitionRawChildren(slots.default(), true) @@ -211,23 +209,11 @@ const BaseTransitionImpl: ComponentOptions = { const oldChild = instance.subTree const oldInnerChild = oldChild && getKeepAliveChild(oldChild) - let transitionKeyChanged = false - const { getTransitionKey } = innerChild.type as any - if (getTransitionKey) { - const key = getTransitionKey() - if (prevTransitionKey === undefined) { - prevTransitionKey = key - } else if (key !== prevTransitionKey) { - prevTransitionKey = key - transitionKeyChanged = true - } - } - // handle mode if ( oldInnerChild && oldInnerChild.type !== Comment && - (!isSameVNodeType(innerChild, oldInnerChild) || transitionKeyChanged) + !isSameVNodeType(innerChild, oldInnerChild) ) { const leavingHooks = resolveTransitionHooks( oldInnerChild,