react折叠收起

前端之家收集整理的这篇文章主要介绍了react折叠收起前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
const textOverflow = { textOverflow: 'ellipsis' };
    statesDom.push(<View style={styles.statusTitle}>
      <Text style={[styles.statusTitleText,titleStyle,textOverflow]}>
        {this.state.topStatusBarTip}</Text>
      <Touchable
        onPress={() => {
          console.log('测试数据测试数据1');
          this.setState({
            isStateDoms: true,});
        }}
      >
        <Text
          style={[styles.statusTitleText,subTitleStyle]}
        >{this.state.topStatusBarSubTip}</Text>
      </Touchable>
    </View>);

    const statesDom1 = []; // 顶部的状态栏
    statesDom1.push(<View style={styles.statusTitle1}>
      <Text style={[styles.statusTitleText,titleStyle]}>{this.state.topStatusBarTip}</Text>
      <Touchable
        onPress={() => {
          console.log('测试数据测试数据2');
          this.setState({
            isStateDoms: false,subTitleStyle]}
        >{this.state.topStatusBarSubTip}</Text>
      </Touchable>
    </View>);

{this. state. isStateDoms ? statesDom1 : statesDom }

猜你在找的React相关文章