尝试在状态中存储有关选定时间的信息时出现错误。感谢您的帮助,感谢您的宝贵时间!如果你们需要更多具体信息,请告诉我。
以下是我的组件中的代码片段:
const Calendar = (props) => {
const [startTime, setStartTime] = React.useState('');
const handleSelect = (selectedInfo) => {
//alert(selectedInfo.startStr);
setStartTime(selectedInfo.startStr);
}
return (
<FullCalendar
defaultView="timeGridWeek"
weekends={false}
allDaySlot={false}
plugins={[ timeGridPlugin, dayGridPlugin, interactionPlugin ]}
minTime="08:00:00"
selectable={true}
selectMirror={true}
selectOverlap={false}
select={handleSelect}
header={{
left: 'prev,next today',
center: 'title',
right: 'dayGridMonth,timeGridWeek,timeGridDay'
}}
events={[
{ title: 'event 1', start: '2020-03-16 10:00:00', end: '2020-03-16 12:00:00' },
{ title: 'event 2', start: '2020-03-19' }
]}
/>
);
}
慕妹3242003
一只名叫tom的猫
相关分类