<DatePicker v-model="SearchMonth" :options="options" type="month" placeholder="请选择月份" :clearable="false" style="width: 144px"></DatePicker> //日历控件,主要是options起作用
data() {
return {
options: {
disabledDate(month) {
let M = moment(new Date()).subtract(1, "month").format("YYYY-MM");
return month.getTime() > new Date(M).getTime();
}
}
}
}