<el-date-picker v-model="yearmonth" type="month" value-format="yyyy-MM" placeholder="请选择月份" :picker-options="pickerOptions">
</el-date-picker>
return {
pickerOptions: {
disabledDate: (time) => {
let arr = this.picArr;//['2023-06','2022-01']
var lj = true;
arr.forEach((i) => {
lj =
lj &&
(time.getTime() <
new Date(
i.split("-")[0],
i.split("-")[1] - 1
) ||
time.getTime() >
new Date(
i.split("-")[0],
i.split("-")[1] - 1
));
});
return lj;
},
},
}
el-date-picker 选择指定的日期
最新推荐文章于 2024-08-30 17:44:11 发布