日期开始之前和今天之后不让选择
<el-date-picker
v-model="pickerTime"
type="monthrange"
align="right"
unlink-panels
range-separator="~"
start-placeholder="开始月份"
end-placeholder="结束月份" :picker-options="pickerOptions"> </el-date-picker> data(){ return{ pickerTime: ['2020-04', new Date()], // 默认显示时间也可以不写 pickerOptions: { disabledDate(time) { return time.getTime() > Date.now() || new Date("2020-04-01 00:00:00").getTime() > time.getTime(); }, } } }