注意:
1、element ui和element plus的时间禁用属性不同,element ui用picker-options,element plus用disabled-date。
原文链接:https://blog.csdn.net/weixin_44358713/article/details/136539121
<z-form ref="versionForm" :model="form" class="refresh-form" size="mini" :inline="true"> <div v-for="(item, index) in form" :key="index"> <div class="table_name"> {{ form[index].tableName }} </div> <z-form-item label="数据日期" label-width="80px"> <z-date-picker v-model="form[index].date" type="daterange" start-placeholder="开始日期" end-placeholder="结束日期" size="mini" :clearable="false" style="width: 100%" :picker-options="pickerOptions(form[index].dateCopy)" format="yyyy-MM-dd" value-format="yyyy-MM-dd" > </z-date-picker> </z-form-item>
data() { return { dialogVisible: false, form: [ { tableName: '', date: [], dateCopy: [], batchNo: '', pushDate: '', }, ], batchNoOptions: [], pickerOptions: (dateCopy) => { console.log(dateCopy); return { disabledDate(time) { let isDis = time.getTime() < new Date(dateCopy[0]).getTime(); let afterDis = time.getTime() > new Date(dateCopy[1]).getTime(); return isDis || afterDis; }, }; }, }; },
标签:picker,el,getTime,element,日期,time,date,dateCopy From: https://www.cnblogs.com/xiaonanxun/p/18283890