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
}
}
}