2 回答
TA贡献1906条经验 获得超3个赞
export default class Calendar extends React.Component{
state = {startTime: ''}
handleSelect = (selectedInfo) => {
//alert(selectedInfo.startStr)
this.setState({ startTime: selectedInfo.startStr})
console.log("working!!", this.state.startTime)
}
render(){
return (
<FullCalendar
defaultView="dayGridMonth"
weekends={false}
allDaySlot={false}
plugins={[timeGridPlugin, dayGridPlugin, interactionPlugin]}
minTime="08:00:00"
selectable={true}
selectMirror={true}
selectOverlap={false}
select={this.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' }
]}
/>
)
}
}
我也有同样的问题。相同的错误信息。我一直在搜索互联网,我想出的解决方案是这样的
添加回答
举报