|
@ -4,7 +4,7 @@ |
|
|
// supports transition mode (out-in / in-out)
|
|
|
// supports transition mode (out-in / in-out)
|
|
|
|
|
|
|
|
|
import { warn } from 'core/util/index' |
|
|
import { warn } from 'core/util/index' |
|
|
import { camelize } from 'shared/util' |
|
|
import { camelize, extend } from 'shared/util' |
|
|
import { getRealChild, mergeVNodeHook } from 'core/vdom/helpers' |
|
|
import { getRealChild, mergeVNodeHook } from 'core/vdom/helpers' |
|
|
|
|
|
|
|
|
export const transitionProps = { |
|
|
export const transitionProps = { |
|
@ -100,9 +100,12 @@ export default { |
|
|
const oldRawChild = this._vnode |
|
|
const oldRawChild = this._vnode |
|
|
const oldChild: any = getRealChild(oldRawChild) |
|
|
const oldChild: any = getRealChild(oldRawChild) |
|
|
|
|
|
|
|
|
|
|
|
if (oldChild && oldChild.data && oldChild.key !== child.key) { |
|
|
|
|
|
// replace old child transition data with fresh one
|
|
|
|
|
|
// important for dynamic transitions!
|
|
|
|
|
|
const oldData = oldChild.data.transition = extend({}, data) |
|
|
|
|
|
|
|
|
// handle transition mode
|
|
|
// handle transition mode
|
|
|
if (mode && oldChild && oldChild.data && oldChild.key !== child.key) { |
|
|
|
|
|
const oldData = oldChild.data.transition |
|
|
|
|
|
if (mode === 'out-in') { |
|
|
if (mode === 'out-in') { |
|
|
// return empty node and queue update when leave finishes
|
|
|
// return empty node and queue update when leave finishes
|
|
|
mergeVNodeHook(oldData, 'afterLeave', () => { |
|
|
mergeVNodeHook(oldData, 'afterLeave', () => { |
|
|