CroudTech / vue-fullcalendar

FullCalendar Wrapper for vue
MIT License
483 stars 100 forks source link

eventsources being called multiple times after navigating away and returning #131

Open rithvikvibhu opened 6 years ago

rithvikvibhu commented 6 years ago

Hi,

I have routing something like this:

/admin/orders
/admin/calendar

And an event source in data:

var data = {
  calendarEventSources: [{
    events (start, end, timezone, callback) {
      HTTP.get(...) // calls callback somewhere in here
    }]
}

This works correctly the first time. Navigating to another route (/admin/orders) and coming back (to /admin/orders) calls the events function twice. This adds on after every navigate, so I end up with 5 entries after 5 page mounts.

Is this the right place for calendarEventSources?

Ta0uf19 commented 6 years ago

I solved this issue by passing eventSource in config data `

data() { return { config: { eventSource: [...] } } `

stedda commented 5 years ago

I have encountered this issue, moving the eventSources into config worked too... But i do have another issue. If i load the events on the page, and change the page to something else, and go back on the calendar page, the events are duplicated... Any1 encountered this issue? Thanks