组件使用的elementPlus
<el-date-picker v-model="ruleForm.RevertDate" type="date" placeholder="选择日期" format="YYYY/MM/DD" value-format="YYYY-MM-DD" style="width: 94%" :disabled-date="pickerOptions">
</el-date-picker><script>
let jyData = ["2024-11-01", "2024-12-26"] //借阅里面的 开始时间-结束时间methods: {/*** 限制选择的日期* @param time */pickerOptions(time) {const startTime = new Date(this.jyData[0]);const endTime = new Date(this.jyData[1]);return time.getTime() < startTime.getTime() || time.getTime() > endTime.getTime();},
}
</script>