Closed martuico closed 7 years ago
Hi, are you referring to the events
array in the parent component?
When is saveProjectionPlot
called?
When all events are being in the calendar this will generate a VisChart. it duplicates list of events. anyhow I change the code to this. Now it is working
<template>
<div ref="calendar"></div>
</template>
<script>
import 'fullcalendar'
export default {
props: {
events: {
type: Array,
required: true
},
editable: {
type: Boolean,
required: false,
default: false
},
droppable: {
type: Boolean,
required: false,
default: false
},
},
data: function(){
return {
cal: null
}
},
mounted(){
var self = this;
self.cal = $(self.$el);
var args = {
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
height: "auto",
allDaySlot: false,
slotEventOverlap: false,
timeFormat: 'HH:mm',
events: self.events,
dayClick: function(date){
self.$emit('day::clicked', date);
self.cal.fullCalendar('gotoDate', date.start);
self.cal.fullCalendar('changeView', 'agendaDay');
},
eventClick: function(event)
{
self.$emit('event::clicked', event);
}
}
if (self.editable){
args.editable = true;
args.eventResize = function(event){
self.$emit('event::resized', event);
}
args.eventDrop = function(event){
self.$emit('event::dropped', event);
}
}
if (self.droppable){
args.droppable = true;
args.eventReceive = function(event){
self.$emit('event::received', event);
}
}
self.cal.fullCalendar(args);
}
}
</script>
It looks like you are no longer using this lib in your last code example, but I am glad you have got it working.
I did a drag and drop events to calendar FYI: events data doesn't update when drag and drop is performed here's my config
here's when updating events