Hello Everyone,
Hope you have good end year season ?
I am having an issue to use v-model="time" inside the date picker.
When I remove it I get the expected inline date picker but to grab the value and dump it inside the component. Once I v-model to the datepicker tag, it does not want to display it on the page.
Could somebody provide me a hint to cover that issue ? thank you very much in advance.
Also I had to write inline="true" like that and not inline=true to obtain the expected effect. The goal is the be able to dump the selected date on the page via {{time}}.
Thank you very much in advance
Here is the current code in datepicker.vue I am using:
<template>
<div>
<datepicker :format="customDate" v-model="time" :inline="true"></datepicker>
{{time}}
</div>
</template>
<script type="text/javascript">
import datepicker from 'vuejs-datepicker';
import moment from 'moment';
export default
{
data()
{
return
{
time:''
}
},
components:
{
datepicker
},
methods:
{
customDate(date)
{
this.time = moment(date).format('DD-MM-YYYY');
}
}
}
</script>
What I have tried:
<datepicker :format="customDate" :inline="true"></datepicker>
works but without v-model tag, why ???