<el-date-picker clearable size="small" v-model="form.yjrq" type="date" value-format="yyyy-MM-dd" label="应缴日期"
:default-value="bydate" :picker-options="dateOptions"></el-date-picker>
data() {
return {
//应缴日期插件默认展开值
bydate: null,
//日期插件可选时间范围限制
dateOptions: {},
}
}
在具体方法中赋值:
xxx(){
let start = 某个时间;
let end = 某个时间;
this.dateOptions = {
disabledDate(time) {
return ( time.getTime() < new Date(start).getTime() ||time.getTime() > new Date(end).getTime());
},
}
}