在官网引入的日期格式中,加入
format=“yyyy-MM-dd HH:mm:ss”
value-format=“yyyy-MM-dd HH:mm:ss”
这样后端接收到的格式就是前段格式化的形式
<span class="demonstration">课程预开始时间</span>
<el-date-picker prop="starttime"
v-model="course.starttime"
type="datetime"
placeholder="选择日期时间"
format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>