zoukankan      html  css  js  c++  java
  • elementUi 日历添加可选区间(只能选择一个月的时间段)

    <el-form-item>
            <el-date-picker clearable v-model="times" :picker-options="pickerOptions"
     type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss" start-placeholder="起始时间" end-placeholder="截止时间"> </el-date-picker>
          </el-form-item>

    js

         times:'',
          pickerOptions: {
          onPick: ({maxDate, minDate}) => {
            this.times= minDate.getTime();
            if (maxDate) {
              this.times= ''
            }
            }, disabledDate: (time) => {
              if (this.times!== '') {
                const one = 30 * 24 * 3600 * 1000;
                const minTime = this.times- one;
                const maxTime = this.times+ one;
                return time.getTime() < minTime || time.getTime() > maxTime
              }
            }
          }
  • 相关阅读:
    bzoj3946
    bzoj3065
    bzoj1500
    bzoj1233
    bzoj1089
    bzoj1087
    bzoj1086
    if语句之猜拳
    if语句判断闰年、平年
    if语句判断身高体重是否标准
  • 原文地址:https://www.cnblogs.com/shuihanxiao/p/13997458.html
Copyright © 2011-2022 走看看