<el-date-picker
v-model="startTime"
format="yyyy-MM-dd HH:mm"
type="datetime"
placeholder="选择日期时间"
:picker-options="pickerOptions">
</el-date-picker>
</div>
pickerOptions: {
selectableRange:(()=>{
let data=new Date();
let hour=data.getHours();
let minute=data.getMinutes();
let second=data.getSeconds();
return [`${hour}:${minute}:${second} - 23:59:59`]
})(),
disabledDate(time) {
var date=new Date();
date.setFullYear(date.getFullYear()+2);
date.setDate(date.getDate()-1);
return (time.getTime() < Date.now() - 8.64e7)||(time.getTime()>date.getTime());
}
},