-
// 首先在constructor里:
-
this.state = { visible: false }
-
// 然后在点击事件设置:
-
this.setState({ visible: true })
-
// render函数里利用三木运算:
-
{this.state.visible ? (
-
<Alert message="用户名或密码错误" type="warning" showIcon />
-
) : null}
React Native 控制一个component的显示隐藏
猜你喜欢
转载自www.cnblogs.com/gloryhope/p/12502738.html
今日推荐
周排行