如何在事件中放置 2 个事件,以便在日历中显示里程碑和预订。我试着这样说:
events={milestones.map(milestone => {
return {
id: milestone.id,
title: milestone.description,
start: milestone.expectedDate
};
})/*, this.state.reservations*/}
这样做只会显示里程碑,但如果我这样说:
events={/*milestones.map(milestone => {
return {
id: milestone.id,
title: milestone.description,
start: milestone.expectedDate
};
})*/ this.state.reservations}
它只显示预订情况。我怎样才能以一种方式显示它们呢?
我试着这样说,但它仍然只显示第一个:
events={milestones.map(milestone => {
return {
id: milestone.id,
title: milestone.description,
start: milestone.expectedDate
};
}) , this.state.reservations}
我终于解决了问题!
events={[...milestones.map(milestone => ({
id: milestone.id,
title: milestone.description,
start: milestone.expectedDate
})), ...this.state.reservations]}