element-ui日期选择器
<el-date-picker
v-model="filters.dateValue"
type="daterange"
value-format="yyyy-MM-dd"
:default-time="['00:00:00', '23:59:59']"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
filters: {
dateValue: ["", ""],
dateValue: ["", ""],
},
//因为选择时间,然后删除时间后再次搜索,会直接报错。后发现容错如下:
beginDate:
this.filters.dateValue != null
? this.filters.dateValue[0]
: this.filters.dateValue,
endDate:
this.filters.dateValue != null
? this.filters.dateValue[1]
: this.filters.dateValue,
------------------------------------------------时间回显------------------------------------------------
this.filters= Object.assign({}, val);
this.filters.dateValue = [];
this.filters.dateValue.push(val.startTime)
this.filters.dateValue.push(val.endTime)
本文来自博客园,作者:云霄紫潭,转载请注明原文链接:https://www.cnblogs.com/0520euv/p/12183143.html