Skip to content

Commit

Permalink
feat: 增加 warning 根组件为 <fragment> 时不支持反解 close baidu#98
Browse files Browse the repository at this point in the history
  • Loading branch information
shirookie committed Apr 23, 2021
1 parent 69436de commit ce0d94f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/compilers/anode-compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ export class ANodeCompiler<T extends 'none' | 'typed'> {
if (TypeGuards.isAForNode(aNode)) return this.compileFor(aNode)
if (TypeGuards.isASlotNode(aNode)) return this.compileSlot(aNode)
if (TypeGuards.isATemplateNode(aNode)) return this.compileTemplate(aNode)
if (TypeGuards.isAFragmentNode(aNode)) return this.compileFragment(aNode)
if (TypeGuards.isAFragmentNode(aNode)) {
if (isRootElement) {
console.warn('根元素为 <fragment> 不支持反解')
}
return this.compileFragment(aNode)
}

const childComponentReference = this.generateRef(aNode)
if (childComponentReference) {
Expand Down

0 comments on commit ce0d94f

Please sign in to comment.