react折叠收起

    const textOverflow = { textOverflow: 'ellipsis' };
    statesDom.push(
      
        {this.state.topStatusBarTip}
       {
          console.log('测试数据测试数据1');
          this.setState({
            isStateDoms: true,
          });
        }}
      >
        {this.state.topStatusBarSubTip}
      
    );

    const statesDom1 = []; // 顶部的状态栏
    statesDom1.push(
      {this.state.topStatusBarTip}
       {
          console.log('测试数据测试数据2');
          this.setState({
            isStateDoms: false,
          });
        }}
      >
        {this.state.topStatusBarSubTip}
      
    );

{this. state. isStateDoms ? statesDom1 : statesDom }

你可能感兴趣的:(JavaScript)