在写form表单的时候,有个日期限制不让选今天之后的日期,翻阅ElementPlus官网, 发现原来的picker-options已经废弃了,现在使用的是disabled-date 使用如下 <el-form-item label="校验日期:" prop="checkDate"> <el-date-picker v-model="checkForm.checkDate" type="date" value-format="YYYY-MM-DD" :disabled-d...
constdisabledDate = (time) =>{returntime.getTime() >Date.now() } 禁止选择今天之前的日期 (当天可选) constdisabledDates = (time) =>{returntime.getTime() < Date.now() -8.64e7}
时间、分钟禁选 */constdisabledDateTime=moment("2022-11-23 09:20");/** 禁选日期 */constdisabledDate=(time:Date)=>{returntime.getTime()>moment(disabledDateTime).toDate().getTime();};/** 禁选小时:如果当前选择的日期和被禁选的日期为同一天,则进行小时的禁用 */constdisabledHour=()=>{if(...
const dateStr = date.toISOString().split('T')[0] // 由于 isIncluded 为 true 时表示日期可选 // 所以当日期在工作日数组中时应该返回 false(不禁用) // 当日期不在工作日数组中时应该返回 true(禁用) // await nextTick() const isWorkingDay = workdays.value.includes(dateStr) console.log(isW...
<el-date-picker v-model="model.stageDate"type="date"placeholder="请选择周期日期":disabled-date="disabledDate"format="YYYY-MM-DD"value-format="YYYY-MM-DD"/> methods:{disabledDate(newV){returnnewV.getTime()<newDate().getTime()},} ...
Bug Type: Component Environment Vue Version: 3.3.4 Element Plus Version: 2.3.6 Browser / OS: Mozilla/5.0 (Windows NT 10.0; Win64; x64) Build Tool: Vite Reproduction Related Component el-date-picker Reproduction Link Element Plus Playgrou...