button 多个条件判断渲染

 React 组件中 判断多条件

 button 多个条件判断渲染

          {data.judgeVoteList && data.judgeNum === data.judgeVoteList.length ? (
            <Button
              disabled={isDisable || vote.code === 1 || vote.code === 2 || !clickName.de281}
              className={styles.submitBtn}
              type="primary"
              onClick={onSubmit}
            >
              {/*{vote.code === 2 && <Button type="primary">进入评审</Button>}*/}
              {!isDisable && vote.code !== 2 && vote.code !== 1
                ? '提交'
                : '已提交' && (
                    <>
                      已提交
                      {vote.code === 1 && (
                        <p className={styles.subResult}>已提交,请耐心等待评审结果</p>
                      )}
                    </>
                  )}
            </Button>
          ) : (
            <div>
              <Button disabled className={styles.submitBtn} type="primary" onClick={onSubmit}>
                提交
              </Button>
              <p>评委邀请中, 请稍后...</p>
            </div>
          )}

  

          {data.judgeVoteList && data.judgeNum === data.judgeVoteList.length ? (
            [
              vote.code !== 2 && (
                <Button
                  disabled={isDisable || vote.code === 1 || vote.code === 2 || !clickName.de281}
                  className={styles.submitBtn}
                  type="primary"
                  onClick={onSubmit}
                >
                  {!isDisable && vote.code !== 2 && vote.code !== 1
                    ? '提交'
                    : '已提交' && (
                        <>
                          已提交
                          {vote.code === 1 && (
                            <p className={styles.subResult}>已提交,请耐心等待评审结果</p>
                          )}
                        </>
                      )}
                </Button>
              ),
              vote.code === 2 && (
                <Button type="primary" className={styles.submitBtn}>
                  进入评审
                </Button>
              ),
            ]
          ) : (
            <div>
              <Button disabled className={styles.submitBtn} type="primary" onClick={onSubmit}>
                提交
              </Button>
              <p>评委邀请中, 请稍后...</p>
            </div>
          )}

  

 

posted @ 2021-08-11 16:36  紫夜殇  阅读(153)  评论(0)    收藏  举报