fix(runtime-core): should allow empty string and 0 as valid vnode key (#807)

This commit is contained in:
djy0
2020-03-10 04:03:57 +08:00
committed by GitHub
parent b13886b1ba
commit 54a0e93c27
2 changed files with 9 additions and 1 deletions

View File

@@ -251,7 +251,7 @@ export function createVNode(
_isVNode: true,
type,
props,
key: (props !== null && props.key) || null,
key: props !== null && props.key !== undefined ? props.key : null,
ref: (props !== null && props.ref) || null,
scopeId: currentScopeId,
children: null,