我有这个小代码片段
<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) 吐出 0
console.log(isSelected) 吐出 false
但是,console.log("here") 永远不会被触发。由于我是 JS 新手,我假设 JS 评估真实性的方式有些古怪,我不知道任何帮助将不胜感激
跃然一笑
ibeautiful
呼唤远方
温温酱
随时随地看视频慕课网APP
相关分类