element-plus [Bug Report] El-date-picker default value not working

pb3skfrl  于 2022-10-21  发布在  其他
关注(0)|答案(2)|浏览(257)

Element Plus version

1.1.0-beta.8

OS/Browsers version

chrome

Vue version

3.2.8

https://codesandbox.io/s/element-plus-spa-forked-6wtbz?file=/src/App.vue

Steps to reproduce

Hi,
When use date picker with a default value to today, default-value can not compute value from new Date(Date.now())

What is Expected?

I should expect to see today date prefilled

What is actually happening?

the date picker input is blank

mzsu5hc0

mzsu5hc01#

:default-value="defaultValue" is optional default date of the calendar,The default value displayed is the value of v-model

kkbh8khc

kkbh8khc2#

@ntgraph , as @imswk says, you could set value to const value = ref(new Date(Date.now())); : https://codesandbox.io/s/element-plus-spa-forked-b2imb?file=/src/App.vue

相关问题