<el-date-picker v-model="reportFrom.month" type="month" placeholder="选择月"
value-format="yyyy-MM" format="yyyy-MM" :picker-options="pickerOptions">
</el-date-picker>
return {
pickerOptions: this.getTime(),
}
getTime () {
return {
disabledDate (time) {
const date = new Date();
const year = date.getFullYear();
let month = date.getMonth() + 1;
if (month >= 1 && month <= 9) {
month = "0" + month;
}
const currentdate = year.toString() + month.toString();
const timeyear = time.getFullYear();
let timemonth = time.getMonth() + 1;
if (timemonth >= 1 && timemonth <= 9) {
timemonth = "0" + timemonth;
}
const timedate = timeyear.toString() + timemonth.toString();
return currentdate <= timedate;
},
};
}