From f879bf6287acd32330a948eb6964ad928a18d2c8 Mon Sep 17 00:00:00 2001 From: yuche Date: Wed, 3 Jul 2019 16:26:54 +0800 Subject: [PATCH] =?UTF-8?q?fix(transformer):=20=E5=A6=82=E6=9E=9C=E5=BE=AA?= =?UTF-8?q?=E7=8E=AF=E5=9C=A8=E4=B8=89=E5=85=83=E8=A1=A8=E8=BE=BE=E5=BC=8F?= =?UTF-8?q?=E4=B8=AD=E6=B2=A1=E6=9C=89=E8=A2=AB=20JSX=20=E5=8C=85=E8=A3=B9?= =?UTF-8?q?=E4=BD=8F=E8=A7=A3=E6=9E=90=E5=87=BA=E9=94=99=20close=20#3646?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-transformer-wx/src/render.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/taro-transformer-wx/src/render.ts b/packages/taro-transformer-wx/src/render.ts index 96679487bd38..204183ab8228 100644 --- a/packages/taro-transformer-wx/src/render.ts +++ b/packages/taro-transformer-wx/src/render.ts @@ -333,6 +333,10 @@ export class RenderParser { } else if (t.isJSXElement(alternate) && t.isCallExpression(consequent) && !isArrayMapCallExpression(parentPath.get('consequent'))) { const id = generateAnonymousState(this.renderScope, parentPath.get('consequent') as any, this.referencedIdentifiers, true) parentPath.get('consequent').replaceWith(id) + } else if (t.isJSXElement(alternate) && isArrayMapCallExpression(parentPath.get('consequent'))) { + // + } else if (t.isJSXElement(consequent) && isArrayMapCallExpression(parentPath.get('alternate'))) { + // } else { block.children = [t.jSXExpressionContainer(consequent)] newJSXIfAttr(block, test)