Skip to content

Commit 2540c37

Browse files
committed
fix dynamic transition type for higher-order transition components (fix #4545)
1 parent 7f25f73 commit 2540c37

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Diff for: src/platforms/web/runtime/components/transition.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ function hasParentTransition (vnode) {
6262
}
6363
}
6464

65+
function isSameChild (child, oldChild) {
66+
return oldChild.key === child.key && oldChild.tag === child.tag
67+
}
68+
6569
export default {
6670
name: 'transition',
6771
props: transitionProps,
@@ -126,11 +130,10 @@ export default {
126130
const oldRawChild = this._vnode
127131
const oldChild: any = getRealChild(oldRawChild)
128132

129-
if (oldChild && oldChild.data && oldChild.key !== key) {
133+
if (oldChild && oldChild.data && !isSameChild(child, oldChild)) {
130134
// replace old child transition data with fresh one
131135
// important for dynamic transitions!
132-
const oldData = oldChild.data.transition = extend({}, data)
133-
136+
const oldData = oldChild && (oldChild.data.transition = extend({}, data))
134137
// handle transition mode
135138
if (mode === 'out-in') {
136139
// return placeholder node and queue update when leave finishes

0 commit comments

Comments
 (0)