浏览代码

fix: vnode key ref should default to null

Evan You 7 年之前
父节点
当前提交
693938d956
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      packages/runtime-core/src/vnode.ts

+ 2 - 2
packages/runtime-core/src/vnode.ts

@@ -119,8 +119,8 @@ export function createVNode(
   const vnode: VNode = {
     type,
     props,
-    key: props && props.key,
-    ref: props && props.ref,
+    key: (props && props.key) || null,
+    ref: (props && props.ref) || null,
     children: null,
     component: null,
     el: null,