Scenario
I'm changing a themes default and super ugly datepicker and decided to use bootstraps datepicker, found here. The problem im having is that my 'v-model' attribute isnt doing anything when i use the datepicker, but its doing something when i type in the input field.
Code
// Html
<div class="position-relative has-icon-left">
<input v-model="user.date_of_birth" placeholder="dd/mm/yyyy" id="date-of-birth" class="form-control datepicker" name="date">
@{{ user.date_of_birth }}
</div>
// javascript
$('.datepicker').datepicker({
format: 'dd/mm/yyyy',
setDate: new Date()
});
the datepicker works and is initialised and it changes the value on the input field. My problem is that v-model is completely ignored unless i physically type in the field!
Question
How do i get v-model to work with this datepicker?
Is there a specific reason that v-model isn't working with this datepicker?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…