mirror of
https://gitee.com/vuejs/vue.git
synced 2024-12-05 05:27:59 +08:00
ensure instance-unique keys for <transition> child nodes during pending node removal (fix #4702)
This commit is contained in:
parent
c66991d961
commit
85d6f115bb
@ -127,9 +127,13 @@ export default {
|
|||||||
return placeholder(h, rawChild)
|
return placeholder(h, rawChild)
|
||||||
}
|
}
|
||||||
|
|
||||||
const key = child.key = child.key == null || child.isStatic
|
// ensure a key that is unique to the vnode type and to this transition
|
||||||
? `__v${child.tag + this._uid}__`
|
// component instance. This key will be used to remove pending leaving nodes
|
||||||
: child.key
|
// during entering.
|
||||||
|
const id = `__transition-${this._uid}-`
|
||||||
|
const key = child.key = child.key == null
|
||||||
|
? id + child.tag
|
||||||
|
: child.key.indexOf(id) === 0 ? child.key : id + child.key
|
||||||
const data = (child.data || (child.data = {})).transition = extractTransitionData(this)
|
const data = (child.data || (child.data = {})).transition = extractTransitionData(this)
|
||||||
const oldRawChild = this._vnode
|
const oldRawChild = this._vnode
|
||||||
const oldChild: any = getRealChild(oldRawChild)
|
const oldChild: any = getRealChild(oldRawChild)
|
||||||
|
@ -103,7 +103,6 @@ export function enter (vnode: VNodeWithData, toggleDisplay: ?() => void) {
|
|||||||
const parent = el.parentNode
|
const parent = el.parentNode
|
||||||
const pendingNode = parent && parent._pending && parent._pending[vnode.key]
|
const pendingNode = parent && parent._pending && parent._pending[vnode.key]
|
||||||
if (pendingNode &&
|
if (pendingNode &&
|
||||||
pendingNode.context === vnode.context &&
|
|
||||||
pendingNode.tag === vnode.tag &&
|
pendingNode.tag === vnode.tag &&
|
||||||
pendingNode.elm._leaveCb) {
|
pendingNode.elm._leaveCb) {
|
||||||
pendingNode.elm._leaveCb()
|
pendingNode.elm._leaveCb()
|
||||||
|
Loading…
Reference in New Issue
Block a user