Skip to content

Commit

Permalink
fix(transformer): 如果循环在三元表达式中没有被 JSX 包裹住解析出错
Browse files Browse the repository at this point in the history
close #3646
  • Loading branch information
yuche committed Jul 3, 2019
1 parent ef09747 commit f879bf6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/taro-transformer-wx/src/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f879bf6

Please sign in to comment.