element [bug report] form validation date rule error

5kgi1eie  于 2022-10-26  发布在  其他
关注(0)|答案(3)|浏览(235)

Element UI version

2.13.2

OS/Browsers version

win10/ Chrome83.0.4103.116

Vue version

3.0.0-rc.5

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?

控制台报错

bd1hkmkf

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

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

zphenhs4

zphenhs42#

你把日期字段校验的type: 'date'去掉就ok了,也不需要校验这个。你设置value-format后就是字符串类型了,但是你又校验是不是日期类型,所以才报错

sshcrbum

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.

相关问题