瀏覽代碼

fix(core): should not warn extraneous props when root is toggled

Evan You 6 年之前
父節點
當前提交
a58da63f16
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      packages/runtime-core/src/componentRenderUtils.ts

+ 1 - 1
packages/runtime-core/src/componentRenderUtils.ts

@@ -75,7 +75,7 @@ export function renderComponentRoot(
         result.shapeFlag & ShapeFlags.COMPONENT
       ) {
         result = cloneVNode(result, attrs)
-      } else if (__DEV__ && !accessedAttrs) {
+      } else if (__DEV__ && !accessedAttrs && result.type !== Comment) {
         warn(
           `Extraneous non-props attributes (${Object.keys(attrs).join(',')}) ` +
             `were passed to component but could not be automatically inherited ` +