-
// 首先在constructor里: -
this.state = { visible: false } -
// 然后在点击事件设置: -
this.setState({ visible: true }) -
// render函数里利用三木运算: -
{this.state.visible ? ( -
<Alert message="用户名或密码错误" type="warning" showIcon /> -
) : null}
相关文章:
// 首先在constructor里:this.state = { visible: false }// 然后在点击事件设置:this.setState({ visible: true })// render函数里利用三木运算:{this.state.visible ? ( <Alert message="用户名或密码错误" type="warning" showIcon />) : null}相关文章: