ManukMinasyan / vue-functional-calendar

Vue.js Functional Calendar | Component/Package
https://vue-functional-calendar.now.sh/
MIT License
468 stars 84 forks source link

watch on disabledDates / update fallback #78

Closed Sysix closed 4 years ago

Sysix commented 4 years ago

Hello,

it would be really helpful when the calendar is watching for disabledDates property. As an example, I'm requesting my API to get the dates. So atm of "mounted" the disabledDates are empty.

currently im trying follow exmple, but it is ~not~ working:

<FunctionalCalendar ref="calendar"
                                    :is-date-picker="true"
                                    v-on:choseDay="onDaySelect"
                                    v-on:changedMonth="onMonthChange"
                                    v-on:changedYear="onYearChange"
                                    :disabled-dates="disabledDaysOfMonth"
                                    date-format="yyyy-mm-dd"
                />
 selectedMonth: function() {
                this.isLoadingCalendar = true;

                (async () => {

                    this.disabledDaysOfMonth = await getDisabledDatesOfMonth(this.selectedYear, this.selectedMonth);
                    this.isLoadingCalendar = false;

                    await this.$nextTick();

                    this.$refs.calendar.setConfigs();
                    this.$refs.calendar.updateCalendar();
                })();
            }

EDIT: add workaround