美文网首页
Element date-picker

Element date-picker

作者: 高磊_IT | 来源:发表于2020-12-13 13:24 被阅读0次
let startTime: any;
let endTime: any;
//定义在export外面
export default class PrintAccount extends Vue {
<el-date-picker v-model="chooseDate" type="daterange" :picker-options="pickerOptions" start-placeholder="开始日期" range-separator="至" end-placeholder="结束日期">
              </el-date-picker>
  async getTimeRange() {
    let resvMainNo: string = "";
    let scope: string = "";
    if (this.billItemList) {
      resvMainNo = this.billItemList.resvMainNo;
      scope = "RESV_MAIN";
    }
    const timeRange = await queryDataRange(resvMainNo, scope);
    startTime = new Date(timeRange.minDate).getTime();
    endTime = new Date(timeRange.maxDate).getTime();
    console.log(startTime, endTime);
  }

  // 時間選擇
  private pickerOptions = {
    disabledDate(time: any) {
      console.log(startTime, endTime);
      return time.getTime() > endTime  || time.getTime() < startTime - 8.64e7;
    },
  };

相关文章

网友评论

      本文标题:Element date-picker

      本文链接:https://www.haomeiwen.com/subject/ujaugktx.html