From ce0d94fc1a034749f090839fa6ddb8999fa3fb9e Mon Sep 17 00:00:00 2001 From: shirookie <65142075@qq.com> Date: Fri, 23 Apr 2021 13:44:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=20warning=20?= =?UTF-8?q?=E6=A0=B9=E7=BB=84=E4=BB=B6=E4=B8=BA=20=20=E6=97=B6?= =?UTF-8?q?=E4=B8=8D=E6=94=AF=E6=8C=81=E5=8F=8D=E8=A7=A3=20close=20#98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/compilers/anode-compiler.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/compilers/anode-compiler.ts b/src/compilers/anode-compiler.ts index 1ad01bdb..b9afc115 100644 --- a/src/compilers/anode-compiler.ts +++ b/src/compilers/anode-compiler.ts @@ -38,7 +38,12 @@ export class ANodeCompiler { 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('根元素为 不支持反解') + } + return this.compileFragment(aNode) + } const childComponentReference = this.generateRef(aNode) if (childComponentReference) {