我有這個小代碼片段 <Calendar style={{ height: 600, width: "120%" }} eventPropGetter={(event, start, end, isSelected) => { var backgroundColor = "#000000"; console.log(event.estado); console.log(isSelected); if (event.estado === 0 && isSelected === false) console.log("here"); if (event.estado === 0 && isSelected === true) backgroundColor = "#4d4dff"; if (event.estado === 2 && isSelected === true) backgroundColor = "#ff8c1a"; if (event.estado === 2 && isSelected === false) backgroundColor = "#b35900"; return { style: { backgroundColor } }; }}console.log(event.estado) 吐出 0console.log(isSelected) 吐出 false但是,console.log("here") 永遠不會被觸發(fā)。由于我是 JS 新手,我假設 JS 評估真實性的方式有些古怪,我不知道任何幫助將不勝感激
如果在它應該被觸發(fā)時沒有被觸發(fā)
躍然一笑
2022-10-08 18:01:25