vue-bulma / datepicker

Datepicker Component for Vue Bulma
MIT License
115 stars 56 forks source link

v-model not being updated #35

Closed phamels closed 7 years ago

phamels commented 7 years ago

Hi,

using the following code:

<datepicker :config="{ dateFormat: 'd-m-Y'" v-model="datum"></datepicker>

displays the datepicker properly and allows me to select a date, however upon selecting a new date, v-model is not being updated. I also tried like this:

<datepicker :config="{ dateFormat: 'd-m-Y', onChange: dateChange() }" v-model="datum"></datepicker>

though it only gets triggered the first time upon setting the datum value from an axios request; where the data is being changed. It seems like selecting a new date using the datepicker, doesn't trigger anything for me and doesn't update the v-model at all. Using Vue 2.2.6

phamels commented 7 years ago

More info: using Laravel 5.4; component loads fine; doesn't seem to work; though I can trigger an event when I change in index.vue of vue-bulma-datepicker for example and click outside the datepicker:

methods: { closePicker () { console.log('bla'); this.datepicker.close() } },

phamels commented 7 years ago

Just made it emit the value since v-model binding is not working.

phamels commented 7 years ago

my mistake, didn't load the component properly. Working now except an error I get when I try to define :config options, even though the options are accepted:

[Vue warn]: Error in callback for watcher "config": "TypeError: Cannot read property 'call' of undefined" TypeError: Cannot read property 'call' of undefined