[update 87527] 日期多选组件,去掉输入的错误格式
This commit is contained in:
@@ -101,7 +101,8 @@ export default {
|
|||||||
const oldVal = this.checkedValue.join(',')
|
const oldVal = this.checkedValue.join(',')
|
||||||
if (newVal !== oldVal) {
|
if (newVal !== oldVal) {
|
||||||
if (newVal) {
|
if (newVal) {
|
||||||
this.checkedValue = [...new Set(newVal.split(','))]
|
// 去重、去掉格式不对的
|
||||||
|
this.checkedValue = [...new Set(newVal.split(','))].filter(dateStr => dateStr && /^\d{4}-\d{2}-\d{2}$/.test(dateStr))
|
||||||
} else {
|
} else {
|
||||||
this.checkedValue = []
|
this.checkedValue = []
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user