From 11964f85cd5fe9c18c18d458a30b6e3a68fb124e Mon Sep 17 00:00:00 2001 From: yuche Date: Wed, 3 Jul 2019 11:42:19 +0800 Subject: [PATCH] =?UTF-8?q?fix(transformer):=20=E6=9F=90=E4=BA=9B=E6=83=85?= =?UTF-8?q?=E5=86=B5=E8=A7=A3=E6=9E=90=20...props=20=E9=94=99=E8=AF=AF?= =?UTF-8?q?=EF=BC=8Cclose=20#3647?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-transformer-wx/src/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/taro-transformer-wx/src/utils.ts b/packages/taro-transformer-wx/src/utils.ts index e49d071515ec..ea879bd36ea0 100644 --- a/packages/taro-transformer-wx/src/utils.ts +++ b/packages/taro-transformer-wx/src/utils.ts @@ -659,7 +659,7 @@ export function setAncestorCondition (jsx: NodePath, expr: t.Expression) Adapter.if, Adapter.else ]) - const logicalJSX = jsx.findParent(p => p.isJSXElement() && p.node.openingElement.attributes.some(a => ifAttrSet.has(a.name.name as string))) as NodePath + const logicalJSX = jsx.findParent(p => p.isJSXElement() && p.node.openingElement.attributes.some(a => t.isIdentifier(a.name) && ifAttrSet.has(a.name.name))) as NodePath if (logicalJSX) { const attr = logicalJSX.node.openingElement.attributes.find(a => ifAttrSet.has(a.name.name as string)) if (attr) {