使用disabledDate属性来进行设置
<a-col :span="24">
<a-form-item label="办结时限" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker @change="onChangeRange" :disabled-date="disabledDate" v-decorator="['time', rules.time]"
:allowClear="false" />
</a-form-item>
</a-col>
disabledDate(current) {
// return current && current < moment().endOf('day') //官方方法禁用今日及之前日期
return current < moment().subtract(1, 'day')//1 改为0为包括今日禁用,今天之后日期禁用
// return current > moment().subtract(1, 'day')//1 改为0为包括今日禁用,今天之前日期禁用
},
文章介绍了如何在AntDesignVue的a-range-picker组件中使用disabledDate属性来设置日期范围,以禁止选择当前日期之前或者特定日期之后的日期。通过调整moment.js的函数,可以控制日期选择的可用性,例如禁用今日及之前的日期或仅禁用今日之前的日期。
1960

被折叠的 条评论
为什么被折叠?



