From bbedae985bd615918dc6091c1b5bacaf0ab8dd94 Mon Sep 17 00:00:00 2001 From: laibo102 Date: Fri, 19 Aug 2022 14:31:42 +0800 Subject: [PATCH] Bugfix: fixed the tabContent's children transform Signed-off-by: laibo102 Change-Id: Ic7f6b388426a73f2b71f1453c2cece878909af12 --- compiler/src/process_component_build.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index f0896b4..53caa03 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -827,10 +827,9 @@ function processTabContent(node: ts.ExpressionStatement, innerCompStatements: ts ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier(TABCONTENT_COMPONENT), ts.factory.createIdentifier(COMPONENT_POP_FUNCTION)), undefined, [])); const tabAttrs: ts.Statement[] = []; - if (TabContentBody) { - const TabContentBodyChild = TabContentBody.statements[0] as ts.ExpressionStatement; + if (TabContentBody && TabContentBody.statements.length) { const newTabContentChildren: ts.Statement[] = []; - processInnerComponent(TabContentBodyChild, newTabContentChildren, log); + processComponentChild(TabContentBody, newTabContentChildren, log); tabContentCreation = ts.factory.createExpressionStatement( ts.factory.createCallExpression(ts.factory.createPropertyAccessExpression( ts.factory.createIdentifier(TABCONTENT_COMPONENT), ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION)),