Vue v-model does not work as expected for ion-input not for ion-datetime

Bug Report

When using ionic components in vue with the alpha.13/dist the v-model binding in vue does not update the linked variable when the value in the input field changes.
With the ion-input there is a workaround because you can bind to the input event.
Unluckily the ion-datetime does not fire the input or the change event or any other useful event that you can use to update the value of the linked variable.

I think we need you to emit a change or input event when in the ion-datetime you tap on the Done button

Author: Fantashit

4 thoughts on “Vue v-model does not work as expected for ion-input not for ion-datetime

  1. Incase anyone is still struggling with this, this workaround seems to work for me.

    <ion-datetime v-bind:value="model" v-bind:ionChange="model = $event.target.value"> </ion-datetime>

  2. Thanks everyone, we’re tracking this and will make sure it’s working 100%% before we leave beta. In the meantime thanks for the workarounds provided above. If you’re struggling with this you can achieve it through some of the comments above.

Comments are closed.