【发布时间】:2018-02-01 03:08:43
【问题描述】:
我不知道怎么写。我在胖箭头中有这个三元运算符。但如果无法执行代码。我在 browserify 或控制台上没有收到任何错误,但它只是不打印标题。
如果我删除 {} 和三元运算符,它可以正常工作。
我写错了什么?
<Row className="grid-header">
{
this.props.columnsInfo.map((info) => {
width = (info.colWidth) ? "className={info.colWidth}" : "xs={this.calculateColumnSize()}";
<Col style={{ paddingTop: 10, paddingLeft: 10 }} key={info.header} width>{info.header}</Col>
})
}
</Row>
【问题讨论】:
标签: javascript arrays if-statement jsx higher-order-functions