mengxiong10 / vue-datepicker-next

A datepicker / datetimepicker component for Vue3
https://mengxiong10.github.io/vue-datepicker-next/
MIT License
147 stars 34 forks source link

Datepicker does not show initialized date #33

Closed eakenbor closed 1 year ago

eakenbor commented 1 year ago

When I initialize my date picker with a date, it does not appear until I manual pick the date. Default-value does not work either.

Here is my code:

<Datepicker
         v-model:value="date"
        type="date"
         format="DD MMM 'YY"
         value-type="format"
         placeholder="To"
        @change="calcDate()"
         :disabled-date="
        (date) =>
         date <new Date() "
        />
...

data(){
return {
date:  "2023-01-11T23:00:00.000Z"
}}

Please @mengxiong10 or anyone, can you help with this? Is there something I am doing wrong? Thanks.

mengxiong10 commented 1 year ago

When you set the value-type, your date should be the type "DD MMM YY" (date: '11 Jan 23')