Closed dimamarksman closed 7 years ago
What's your issue? I think it works properly.
<datepicker v-model="value"></datepicker>
Is there cdn or any public access to the datepicker plugin to show example in a sandbox?
I have the same problem...
<datepicker v-model="value"></datepicker>
if I set value
, it won't be shown in the input.
@luventa what is a reason to assign v-model="value"
here?
The value
is always empty string there that's why the input is always empty in the begining.
I dropped this v-model on my side and use defaultDate
option (flatpickr) to assign initial value as a workaround.
But it is not the way the v-model
directive should work. It should be allowed to put an initial value in the datepicker's v-model
.
Thought you want a init date for it and here is the example code.
<template>
<datepicker v-model="value"></datepicker>
</template>
<script>
import Datepicker from 'vue-bulma-datepicker'
export default {
components: {
Datepicker
},
data () {
return {
value: '2016-12-12'
}
},
watch: {
value (newVal, oldVal) {
console.log(newVal, oldVal)
}
}
}
</script>
Yes, but using wrap: true
option.
<template>
<datepicker v-model="value" :config="{ wrap: true }">
<a class="button" data-toggle><i class="fa fa-calendar"></i></a>
<a class="button" data-clear><i class="fa fa-close"></i></a>
</datepicker>
</template>
<script>
import Datepicker from 'vue-bulma-datepicker'
export default {
components: {
Datepicker
},
data () {
return {
value: '2016-12-12'
}
},
watch: {
value (newVal, oldVal) {
console.log(newVal, oldVal)
}
}
}
</script>
@dimamarksman I think this is a bug. Will fix
Thank you!
21 февр. 2017 г. 12:22 PM пользователь "Pan Yue" notifications@github.com написал:
@dimamarksman https://github.com/dimamarksman I think this is a bug. Will fix
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vue-bulma/datepicker/issues/19#issuecomment-281302779, or mute the thread https://github.com/notifications/unsubscribe-auth/ADHNACDXbnnpOSbVSKT29JvMp5Cgz9YHks5rerrQgaJpZM4L_PxQ .
fixed. Will publish soon. Feel free to reopen Thanks!
Please implement proper working
v-model
with datepicker to be able to set initial date value.