<el-date-picker
type="datetimerange"
start-placeholder="开始时间"
range-separator="至"
end-placeholder="结束时间"
value-format="YYYY-MM-DD HH:mm:ss"
:disabled-date="disabledDate"
/>
// 时间限制
const disabledDate = (time) => {
// 只能选择当前时间的前一个月的和当天之前的
let threeDate = new Date()
threeDate.setMonth(threeDate.getMonth() - 1)
return (
time.getTime() < threeDate.getTime() ||
time.getTime() > new Date().getTime()
)
}