CroudTech / vue-fullcalendar

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

Events not displayed dynamically #23

Closed dzafer closed 7 years ago

dzafer commented 7 years ago

Using <full-calendar ref="calendar" :events="events" ... it works if events is hardcoded in data like below

But if I try to display data from a database, e.g. using VUEX with the mounted() vue method nothing appears

<template>
<full-calendar ref="calendar" :events="list" ...>
{{ list }}
</template>

<script>
 data() {
      return {
        events: [
    {
       title: 'All Day Event',
            start: '2017-06-01'
    }],
        newlist: [ 
    {
        title: 'new data',
            start: '2017-06-02'
    }],

methods: {
      ...mapActions([
        'retrieveAllEvents'
      ]),
computed: {
      ...mapGetters({
        list: "getAllEvents"
      })
 },
mounted() {
      this.retrieveAllEvents()
}

If I'm hardcoding returned result in data: events, it's displayed properly {{ list }} is displayed properly

Same problem if I try to change dynamically the events source (both based in data) using

this.$refs.calendar.$emit( 'renderEvent', this.newlist, true);

Any Help Will Be Welcome

BrockReece commented 7 years ago

Ah it looks like there is a bug on the event watcher. I am fixing it now and will release a new version shortly.

BrockReece commented 7 years ago

Ok, v2.0.1 should now notice changes in the events prop and reload the new events.

dzafer commented 7 years ago

Thank you. really appreciate!