<FullCalendar v-if="isLoadingSucess"
:class="[$style.calenderDetail]"
:options="calendarOptions" ref="FullCalendar"/>
this.$refs.FullCalendar.getApi().next()
this.$refs.FullCalendar.getApi().prev()
this.$refs.FullCalendar.getApi().today()
this.$refs.FullCalendar.getApi().gotoDate(formatData)
this.$refs.FullCalendar.getApi().getDate()
this.$refs.FullCalendar.getApi().view
this.$refs.FullCalendar.getApi().view.calendar.addEvent({
id: 1,
title: `事项xx`,
start: '2021-10-01' + ' 13:00:00',
end: '2021-10-01' + ' 17:00:00',
backgroundColor:'#d8377a',
borderColor:'#d8377a',
})
data() {
let that = this
return {
createEventId: 0,
calendarOptions: {
plugins: [dayGridPlugin,timeGridPlugin,interactionPlugin],
initialView: 'timeGridWeek',
locale:'zh-cn',
buttonText:{
today:'今天',
month:'月',
week:'周',
day:'日',
list:'表'
},
customButtons:{
prevBack: {
text: '后退',
click: function(data) {
that.$refs.FullCalendar.getApi().prev()
}
},
prevGo: {
text: '前进',
click: function(data) {
that.$refs.FullCalendar.getApi().next()
}
},
ToToday: {
text: '今天',
click: function(data) {
that.$refs.FullCalendar.getApi().today()
}
},
},
headerToolbar: {
left: 'prevBack,prevGo ToToday',
center: 'title',
right: 'dayGridMonth,timeGridWeek',
},
initialEvents: [],
selectMirror: true,
dayMaxEvents: true,
weekends: true,
select: this.handleDateSelect,
eventClick: this.handleEventClick,
eventMouseEnter:this.handleEventMouseover,
eventsSet: this.handleEvents,
allDayText: '全天',
allDaySlot: true,
slotMinTime:'06:00:00',
slotMaxTime:'21:00:00',
},
}
},