CroudTech / vue-fullcalendar

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

Google Calendar population #103

Closed lucaspatel closed 6 years ago

lucaspatel commented 6 years ago

Hello,

I am trying to implement this into my Vue project with Google Calendar integration for events, but I can't get it to work. I have just started Vue today and am still figuring it out. Any assistance would be appreciated. The calendar loads fine but does not show any events. I have successfully loaded FullCalendar with just the two parameters below when using vanilla FullCalendar. Am I missing something crucial?

<full-calendar :config="config" :events="events" ref="calendar" />
...
export default {
  name: 'Calendar',
  data () {
    return {
      config: {
        googleCalendarApiKey: 'key here'
      },
      events: {
        googleCalendarId: 'id here'
      }
    }
  },
  components: {
    FullCalendar
  }
}

Thank you.

BrockReece commented 6 years ago

Hey,

So I think you almost have it but you just need to rearrange a few things.

I think something like this should work.

<full-calendar :config="config" :events="events" ref="calendar" />
...
export default {
  name: 'Calendar',
  data () {
    return {
      config: {
        googleCalendarApiKey: 'key here',
        events: {
          googleCalendarId: 'id here'
        }
      },
      events: [],
    }
  },
  components: {
    FullCalendar
  }
}
lucaspatel commented 6 years ago

Works perfectly. Had to specifically import the gcal.js file. Thanks!

RahatChoudhary commented 4 years ago

@lucaspatel hello I am facing same issue which you mentioned above. Please share example how you import gcal.js ?