控制台报错
elementUI
关于elementui控制台报错整理如下:
Error in event handler for “el.form.change“: “TypeError: value.getTime is not a function“
情况:picker组件加了value-format=“yyyy-MM-dd” format="yyyy-MM-dd”格式
并且当前项还有校验规则 type:’date
解决方案:【type: ‘date’】改为【type: ‘string’】
<el-form-item label="日期" :rules=" [{ type: 'date', required: true, message: '请选择日期', trigger: 'change' }]" prop="date" > <el-date-picker v-model="dialogFormContent.date" type="date" placeholder="选择日期" value-format="yyyy-MM-dd" @change="EditDate" > </el-date-picker> </el-form-item>