Skip to content
Merged
2 changes: 1 addition & 1 deletion src/compiler/codegen/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class CodegenState {
this.dataGenFns = pluckModuleFunction(options.modules, 'genData')
this.directives = extend(extend({}, baseDirectives), options.directives)
const isReservedTag = options.isReservedTag || no
this.maybeComponent = (el: ASTElement) => !isReservedTag(el.tag)
this.maybeComponent = (el: ASTElement) => !(isReservedTag(el.tag) && !el.component)
this.onceId = 0
this.staticRenderFns = []
}
Expand Down
5 changes: 5 additions & 0 deletions test/unit/modules/compiler/codegen.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,11 @@ describe('codegen', () => {
'<div :is="component1"></div>',
`with(this){return _c(component1,{tag:"div"})}`
)
// maybe a component and normalize type should be 1
assertCodegen(
'<div><div is="component1"></div></div>',
`with(this){return _c('div',[_c("component1",{tag:"div"})],1)}`
)
})

it('generate component with inline-template', () => {
Expand Down