Shure Alekseev
Shure Alekseev

Reputation: 61

Vue FullCalendar how to set options dynamically?

I need dynamically change some options in Vue FullCalendar, but calendar didn't apply it.

Please look my example https://codesandbox.io/s/3q2j3r7pjq

Button in bottom set maxTime option from 20:00 to 18:00

How i can refresh calendar view?

Upvotes: 1

Views: 2070

Answers (2)

Constantine
Constantine

Reputation: 680

You have to define reference for the calendar component and call setOption on its api

<full-calendar :config="config" :events="events" ref="fullCalendar" />
...
this.$refs.fullCalendar.getApi().setOption('maxTime', '18:00:00');

Upvotes: 0

Shure Alekseev
Shure Alekseev

Reputation: 61

I found it =)

this.$refs.calendar.fireMethod('option', optionName, optionValue)

Upvotes: 3

Related Questions