Skip to content

Commit

Permalink
fix(transformer): 修复条件渲染与 render props 共存的问题
Browse files Browse the repository at this point in the history
close #2890
  • Loading branch information
yuche committed Apr 28, 2019
1 parent dcf0757 commit 13def73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/taro-transformer-wx/src/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1243,7 +1243,7 @@ export class RenderParser {
}
const slotName = getSlotName(name.name)
const slot = cloneDeep(expression)
setJSXAttr(slot, 'slot', t.stringLiteral(slotName))
setJSXAttr(t.isJSXIdentifier(slot.openingElement.name, { name: 'block' }) ? slot.children[0] as t.JSXElement : slot, 'slot', t.stringLiteral(slotName))
jsxElementPath.node.children.push(slot)
path.remove()
}
Expand Down

0 comments on commit 13def73

Please sign in to comment.