<el-form-item label="上架时间" required="required"><el-form:model="courseForm"ref="unmountFormRef"inlinestyle="text-align: left"label-position="left":rules="sjtimeRules"><el-form-itemprop="beginTime"style="width: 37%; margin-right: 0px"><el-date-pickerv-model="courseForm.beginTime"type="datetime"placeholder="选择日期时间"value-format="YYYY-MM-DD HH:mm"format="YYYY-MM-DD HH:mm"data-format="YYYY-MM-DD HH:mm"@change="signStartTimeChange":default-time="defaultBeginTime"/></el-form-item><span style="margin-left: 10px; margin-right: 10px">至</span><el-form-item style="width: 37%"><el-date-pickerv-model="courseForm.endTime"type="datetime"placeholder="选择日期时间"value-format="YYYY-MM-DD HH:mm"format="YYYY-MM-DD HH:mm"data-format="YYYY-MM-DD HH:mm":disabled-date="endPickerOptions"@change="signEndTimeChange":default-time="defaultEndTime"/></el-form-item></el-form></el-form-item>
element中添加这三行都分别去掉秒ss
value-format="YYYY-MM-DD HH:mm"format="YYYY-MM-DD HH:mm"data-format="YYYY-MM-DD HH:mm"
默认时间的时分00:00修改12:00
js
const defaultEndTime = new Date(2000, 1, 1, 12, 0, 0);
const defaultBeginTime = new Date(2000, 1, 1, 12, 0, 0);