element 禁用指定的月份
<el-date-picker v-model='value' type='month' :picker-options='pickerOptions' value-format='yyyy-MM'>
data(){
return{
creatMonthArr: ['2022-07', '2022-08'], //禁止选择的月份
pickerOptions:{
disabledDate:(time)=>{
const year = time.getFullYear()
let month = time.getMonth()+1
if(month<10){ month = '0' + month }
const ym = year + '-' + month
return this.creatMonthArr.includes(ym)
}
}
}
}
效果图: