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)





					


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM