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>
)}

浙公网安备 33010602011771号