]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
refactor(transition): remove unused getTransitionKey logic (#10283)
authorElodie Hill <34654733+royalknight56@users.noreply.github.com>
Sun, 25 Feb 2024 13:14:46 +0000 (21:14 +0800)
committerGitHub <noreply@github.com>
Sun, 25 Feb 2024 13:14:46 +0000 (21:14 +0800)
packages/runtime-core/src/components/BaseTransition.ts

index 20da25848b61aeb5b076a2257ba6dc60a69d98dd..e99fe0e496c699d87ec8155dbf3041eefd99b0a0 100644 (file)
@@ -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,