vue-bulma / datepicker

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

Add value to Props to allow for v-model 2-way binding #22

Closed Towerful closed 7 years ago

Towerful commented 7 years ago

Currently, the value is held in data(){}.
If the parent mutates the v-model value, the datepicker does not reflect the changes

Towerful commented 7 years ago

Actually, this needs some work. Will update the PR

luventa commented 7 years ago

I thought these code I added in WrapperInput before solve this and work fine. Don't them?

mounted () {
    this.value = this.$el.value
  },

But value in props is better for sure 👍

Towerful commented 7 years ago

Perhaps I had a dated version from npm or something.
I had issues with v-model binding a computed property derived from vuex state into the component.
The datepicker would function fine until something else mutated the date, at which point the picker would not react to the the mutation.
Or it would complain about mutating state/props.
Might be a Vue 2.1 thing...