el-date-picker 时间选择范围限制

 <el-date-picker
              v-if="viewer===''||viewer==='creator' || subTaskInfo.status !== 2"
              v-model="ruleForm.planEndtime"
              value-format="yyyy-MM-dd hh:mm:ss"
              type="date"
              :picker-options="pickerTime"
              :disabled="subTaskInfo.disable"
              @change="compareDate"
            />

 //  时间选择范围限制
      pickerTime: {
          disabledDate(time) {
             return time.getTime()< moment(window.matterTark.planStarttime)-24 * 3600 * 1000 || time.getTime()> moment(window.matterTark.planEndtime)+24 * 3600 * 1000;
          },
      },

 

posted @ 2020-08-14 09:30  hongwj  阅读(2497)  评论(0编辑  收藏  举报