mirror of
https://gitee.com/vuejs/vue.git
synced 2024-12-05 05:27:59 +08:00
fix(compiler): maybeComponent should return true when "is" attribute exists (#8114)
close #8101
This commit is contained in:
parent
f5b5b3c96f
commit
aef2a5f3db
@ -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 = []
|
||||
}
|
||||
|
@ -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', () => {
|
||||
|
Loading…
Reference in New Issue
Block a user