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