File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
src/platforms/web/runtime/components Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ export default {
61
61
const removed = [ ]
62
62
for ( let i = 0 ; i < prevChildren . length ; i ++ ) {
63
63
const c = prevChildren [ i ]
64
+ c . data . transition = transitionData
64
65
c . data . pos = c . elm . getBoundingClientRect ( )
65
66
if ( map [ c . key ] ) {
66
67
kept . push ( c )
Original file line number Diff line number Diff line change 4
4
// supports transition mode (out-in / in-out)
5
5
6
6
import { warn } from 'core/util/index'
7
- import { camelize } from 'shared/util'
7
+ import { camelize , extend } from 'shared/util'
8
8
import { getRealChild , mergeVNodeHook } from 'core/vdom/helpers'
9
9
10
10
export const transitionProps = {
@@ -100,9 +100,12 @@ export default {
100
100
const oldRawChild = this . _vnode
101
101
const oldChild : any = getRealChild ( oldRawChild )
102
102
103
- // handle transition mode
104
- if ( mode && oldChild && oldChild . data && oldChild . key !== child . key ) {
105
- const oldData = oldChild . data . transition
103
+ if ( oldChild && oldChild . data && oldChild . key !== child . key ) {
104
+ // replace old child transition data with fresh one
105
+ // important for dynamic transitions!
106
+ const oldData = oldChild . data . transition = extend ( { } , data )
107
+
108
+ // handle transition mode
106
109
if ( mode === 'out-in' ) {
107
110
// return empty node and queue update when leave finishes
108
111
mergeVNodeHook ( oldData , 'afterLeave' , ( ) => {
You can’t perform that action at this time.
0 commit comments