Skip to content

Commit 4f89091

Browse files
committed
handle non-string transition keys
1 parent d3a9a50 commit 4f89091

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/platforms/web/runtime/components/transition.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// supports transition mode (out-in / in-out)
55

66
import { warn } from 'core/util/index'
7-
import { camelize, extend } from 'shared/util'
7+
import { camelize, extend, isPrimitive } from 'shared/util'
88
import { mergeVNodeHook, getFirstComponentChild } from 'core/vdom/helpers/index'
99

1010
export const transitionProps = {
@@ -133,7 +133,9 @@ export default {
133133
const id = `__transition-${this._uid}-`
134134
const key = child.key = child.key == null
135135
? id + child.tag
136-
: child.key.indexOf(id) === 0 ? child.key : id + child.key
136+
: isPrimitive(child.key)
137+
? (String(child.key).indexOf(id) === 0 ? child.key : id + child.key)
138+
: child.key
137139
const data = (child.data || (child.data = {})).transition = extractTransitionData(this)
138140
const oldRawChild = this._vnode
139141
const oldChild: any = getRealChild(oldRawChild)

0 commit comments

Comments
 (0)