Element UI version
2.13.2
OS/Browsers version
win10/ Chrome83.0.4103.116
Vue version
3.0.0-rc.5
Reproduction Link
https://codepen.io/bobsli/pen/YzqwNbo?editable=true%3Dhttps%3A%2F%2Felement.eleme.cn%2F2.13%2F
Steps to reproduce
官方文档的示例代码中<el-date-picker type="date" placeholder="选择日期" v-model="ruleForm.date1" style="width: 100%;"></el-date-picker>
改为如下:<el-date-picker type="date" placeholder="选择日期" v-model="ruleForm.date1" format="yyyy-MM" value-format="yyyy-MM-dd" style="width: 100%;"></el-date-picker>
然后控制台报错
What is Expected?
控制台不报错误信息
What is actually happening?
控制台报错
3条答案
按热度按时间bd1hkmkf1#
Translation of this issue:
Element UI version
2.13.2
OS/Browsers version
win10/ Chrome83.0.4103.116
Vue version
3.0.0-rc.5
Reproduction Link
https://codepen.io/bobsli/pen/YzqwNbo?editable=true%3Dhttps%3A%2F%2Felement.eleme.cn%2F2.13%2F
Steps to reproduce
In the example code of the official document
`
< El date picker type = date "holder = select date" V-model=“ ruleForm.date1 " style="width: 100%;">
`
Change to read as follows:
`
< El date picker type = date "holder = select date" V-model=“ ruleForm.date1 " format="yyyy-MM" value-format="yyyy-MM-dd" style="width: 100%;">
`
Then the console reports an error
What is Expected?
The console does not report an error message
What is actually happening?
Console error
zphenhs42#
你把日期字段校验的type: 'date'去掉就ok了,也不需要校验这个。你设置value-format后就是字符串类型了,但是你又校验是不是日期类型,所以才报错
sshcrbum3#
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.