[Solved] Vue Element Date plug-in reports an error in form validation

Error Messages:

Error in event handler for “el.form.change”: “TypeError: value.getTime is not a function”

Element UI’s date picker el-date-picker in addition to format value-format=”yyyy-MM-dd” and format=”yyyy-MM-dd”
In form validation.

{ type: 'date', required: true, message: 'Please select a date', trigger: 'change' } 

There will be conflicts

Solution: modify the verification rules

type: ‘date’-> type: ‘string’

Possible causes of errors:

After the format conversion of the element UI, the binding value will be converted to a string, and the type: ‘date’ in the verification rule does not match. As for its error, it is converted to a string, not a date object, so there is no gettime method.

Read More: