Warning: [antdv: DatePicker] value provides invalidate moment time. If you want

458 阅读1分钟

报错信息:Warning: [antdv: DatePicker] value provides invalidate moment time. If you want to set empty value, use null instead.

解决方法:

使用:valueFormat=“YYYY-MM-DD HH:mm:ss”

注: 有些时候使用format="YYYY-MM-DD"还是会报错,但valueFormat不会,valueFormat是共同的API
将v-model中的时间转化为moment形式
contract_date: moment(this.record.create_date, 'YYYY-MM-DD'),