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

This commit is contained in:
Evan You 2019-12-02 15:17:30 -05:00
parent 42f3f9e832
commit a58da63f16

View File

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