Html
注:返回格式设置为 value-format="yyyy-MM-dd HH:mm:ss"
<el-date-picker
v-model="timeloop"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
//Data
timeloop:[]
created() {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
//getCurrentTime方法见js方法中,中国标准时间转年月日时分秒
this.timeloop[0]=this.getCurrentTime(start)
this.timeloop[1]=this.getCurrentTime(end)
// console.log(this.timeloop)
},