Element 组件 时间范围波动的写法

前端



js代码

export default {
  data() {
    return {
      UpadtePo: {
        onPick: ({ maxDate, minDate }) => {
          this.choiceDate = minDate.getTime();
          if (maxDate) {
            this.choiceDate = "";
          }
        },
        disabledDate: time => {
          if (this.choiceDate!='') {
            const one = 30 * 24 * 3600 * 1000;
            const minTime = this.choiceDate - one;
            const maxTime = this.choiceDate + one;
            return time.getTime() < minTime || time.getTime() > maxTime;
          }
        }
      }
    };
  }

参考:https://blog.csdn.net/carmen_shao/article/details/83622134

你可能感兴趣的:(vue)