<el-date-picker v-model="value1" type="monthrange" :picker-options="pickerOptions" range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份">
</el-date-picker>
value1: "",
pickerOptions: {
disabledDate(time) {
var year = new Date().getFullYear();
// 获取当前月份
var month = new Date().getMonth() + 1;
month = month > 10 ? month : "0" + month;
return (
new Date(year + "-" + "01-01").getTime() > time.getTime() ||
time.getTime() > new Date(year + "-12-31").getTime()
);
},
},