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

insert image description here

<el-form-item label="服务时间" prop="serviec_time">
           <el-date-picker type="date" value-format="yyyy-MM-dd" placeholder="请选择服务时间" v-model="from.serviec_time">
           </el-date-picker>
    </el-form-item>

Check rules

serviec_time: [ {type: 'date', required: true, message: '请选择服务时间', trigger: 'change'}]

After Baidu, the solution is as follows:
The first:
change the type type to string

serviec_time: [ {type: 'string', required: true, message: '请选择服务时间', trigger: 'change'}]

The second:
remove the type type

serviec_time: [ {type: 'string', required: true, message: '请选择服务时间', trigger: 'change'}]

Guess you like

Origin blog.csdn.net/weixin_44237840/article/details/120722197