React Native 控制一个component的显示隐藏
-
// 首先在constructor里: -
this.state = { visible: false } -
// 然后在点击事件设置: -
this.setState({ visible: true }) -
// render函数里利用三木运算: -
{this.state.visible ? ( -
<Alert message="用户名或密码错误" type="warning" showIcon /> -
) : null}

浙公网安备 33010602011771号