element
element copied to clipboard
[Bug Report] el-date-picker default-time 与 v-model 默认值无法共存
Element UI version
2.15.7
OS/Browsers version
win10 21H2 19044.1889 / 104.0.5112.102(正式版本) (64 位)
Vue version
2.7.10
Reproduction Link
https://codepen.io/pen?editors=1010
Steps to reproduce
default-time="['0:00:00', '23:59:59']" 与 v-model 默认值同时存在
What is Expected?
期望 v-model 设置默认值 在设置 default-time="['0:00:00', '23:59:59']" 可以正常使用 当自动选择的时候 时间默认还是 0点到 23点
What is actually happening?
报错 Cannot read properties of null (reading 'getHours')
Element UI version
2.15.7
OS/Browsers version
win10 21H2 19044.1889 / 104.0.5112.102(正式版本) (64 位)
Vue version
2.7.10
Reproduction Link
https://codepen.io/pen?editors=1010
Steps to reproduce
default-time="['0:00:00', '23:59:59']" 与 v-model 默认值同时存在
What is Expected?
期望 v-model 设置默认值 在设置 default-time="['0:00:00', '23:59:59']" 可以正常使用 当自动选择的时候 时间默认还是 0点到 23点
What is actually happening?
报错 Cannot read properties of null (reading 'getHours')
你粗心了
这里传数组,得用 v-bind:default-time="[xxx,xxx]", 才是转数组,不然就是传了一个字符串,当然报错了