Vue中报错Error in v-on handler: “TypeError: dateObject.getTime is not a function“

  1. 背景:在vue2项目中将表单进行上传,报错Error in v-on handler: "TypeError: dateObject.getTime is not a function"

  1. 分析:找到原因是rules中type:'date’造成的,因为初始化成了string类型。在表单中重新选择时间后此处的时间会变成字符串格式。

  1. 解决:在rules中的日期验证上删除 *type:‘date’,

猜你喜欢

转载自blog.csdn.net/lovecoding1/article/details/129267052
今日推荐