<template>
<el-date-picker v-model="dateValue"
:picker-options="pickerOptions"
type="datetime"
format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-ddTHH:mm:ss"
placeholder="选择日期时间"
:clearable="false">
</el-date-picker>
</template>
export default {
data() {
return {
dateValue: '',
pickerOptions: {
disabledDate(date) {
//disabledDate 文档上:设置禁用状态,参数为当前日期,要求返回 Boolean
return date.getTime() < Date.now() - 24 * 60 * 60 * 1000;
}
},
}
}
}