el-date-picker禁用当前之后日期

<el-date-picker
  size="mini"
  :picker-options="pickerBeginDateBefore"//这里是关键
  class="picker-style"
  v-model="pickerVal"
  type="daterange"
  format="yyyy-MM-dd"
  value-format="yyyy-MM-dd"
  range-separator="-"
  @change="pickerChange"
  start-placeholder="开始日期"
  end-placeholder="结束日期"
></el-date-picker>
data() {
    return {
      pickerBeginDateBefore: {
        disabledDate(time) {
          return time.getTime() > Date.now();
        }
      },
      pickerVal: []
    };
  },

效果图如下
el-date-picker禁用当前之后日期_第1张图片

你可能感兴趣的:(开发DEMO,javascript,vue.js)