Element 日期范围选择获取开始结束时间

<el-date-picker
      v-model="rangeDate"
      prefix-icon="el-icon-date"
      type="daterange"
      start-placeholder="开始日期"
      end-placeholder="结束日期"
      value-format="yyyy-MM-dd HH-mm-ss"
></el-date-picker>

获取开始日期和结束日期

data () {
    return {
      rangeDate: [] 
  } 
watch: {
  rangeDate: function (val, oldVal) {
      if (val !== null) {
        this.beginDate = val[0]
        this.endDate = val[1]
      } else {
        this.beginDate = null
        this.endDate = null
      }
  }
}

 

 

 

https://blog.csdn.net/LinBM123/article/details/90401405

posted @ 2020-04-16 09:56  格鲁特baby  阅读(1190)  评论(0编辑  收藏  举报