diff --git a/src/compiler/parser/index.js b/src/compiler/parser/index.js index d727f8dd4..c4753e129 100644 --- a/src/compiler/parser/index.js +++ b/src/compiler/parser/index.js @@ -86,8 +86,12 @@ export function parse ( platformMustUseProp = options.mustUseProp || no platformGetTagNamespace = options.getTagNamespace || no const isReservedTag = options.isReservedTag || no - maybeComponent = (el: ASTElement) => !!el.component || !isReservedTag(el.tag) - + maybeComponent = (el: ASTElement) => !!( + el.component || + el.attrsMap[':is'] || + el.attrsMap['v-bind:is'] || + !(el.attrsMap.is ? isReservedTag(el.attrsMap.is) : isReservedTag(el.tag)) + ) transforms = pluckModuleFunction(options.modules, 'transformNode') preTransforms = pluckModuleFunction(options.modules, 'preTransformNode') postTransforms = pluckModuleFunction(options.modules, 'postTransformNode') diff --git a/test/unit/modules/compiler/parser.spec.js b/test/unit/modules/compiler/parser.spec.js index c0b01e453..b47de5813 100644 --- a/test/unit/modules/compiler/parser.spec.js +++ b/test/unit/modules/compiler/parser.spec.js @@ -909,4 +909,20 @@ describe('parser', () => { expect(ast.children[2].type).toBe(3) expect(ast.children[2].text).toBe('\ndef') }) + + // #10152 + it('not warn when scoped slot used inside of dynamic component on regular element', () => { + parse(` +
+
+
+
+
+ `, baseOptions) + expect('v-slot can only be used on components or