datepicker
datepicker copied to clipboard
this.$watch('config', this.redraw) doesn't seem to be triggering the redraw method
mounted () {
if (!this.datepicker) {
this.config.onValueUpdate = this.dateUpdated
this.datepicker = new Flatpickr(this.$el, this.config)
this.setDate(this.value)
}
this.$watch('config', this.redraw)
this.$watch('value', this.setDate)
},
methods: {
redraw (newConfig, oldConfig) {
console.log('oldConfig: ', oldConfig)
this.datepicker.config = Object.assign(this.datepicker.config, newConfig)
this.datepicker.redraw()
this.datepicker.jumpToDate()
},
setDate (newDate, oldDate) {
newDate && this.datepicker.setDate(newDate)
},
dateUpdated (selectedDates, dateStr) {
this.date = dateStr
}
},
The redraw
method doesn't seem to be triggered with the config
watcher. The console.log I've put
on it is never called.