【发布时间】:2020-06-04 13:35:54
【问题描述】:
我试图在 jsx 本身中有一个嵌套的 if 条件。这是我的代码示例:
{this.props.customerInformation?
<Descriptions title="Customer Information" bordered>
{this.props.customerInformation.customer_status.label}</Descriptions.Item>
</Descriptions>
:
<Button> Create a new customer </Button>
}
我试图做的是在顶部条件中添加另一个条件,看起来像这样:
{this.props.customerInformation?
<Descriptions title="Customer Information" bordered>
<Descriptions.Item>
{this.props.customerInformation.customer_status.label}
</Descriptions.Item>
<Description.Item>
{this.props.customerInformation.poc?
<Descriptions title="poc" >
{this.props.customerInformation.poc}
<Descriptions.Item>
</Descriptions>
:
<Button> Create a new customer </Button>
}
【问题讨论】:
标签: reactjs