要素の時間範囲セレクターにはデフォルトで時間が表示されます

searchTime:{
   range:[], 
 },
getDefaultdate(){ 
    let myendDate = new Date(); 
    endY = myendDate.getFull Year(); にします。
    endM = myendDate.getMonth() + 1; とします。
    let endD = myendDate.getDate(); 
    let enddate = endY + "-" + (endM < 10 ? "0" + endM : endM) + "-" + (endD < 10 ? "0" + endD : endD); //结束日期
    let day1 = new Date(); 
    day1.setTime(day1.getTime()-24*60*60*1000); 
    let s1 = day1.getFull Year()+"-" + (day1.getMonth()+1) + "-" + day1.getDate(); 
    mystartDate = 新しい日付(s1); にします。
    startY = mystartDate.getFull Year(); にします。
    startM = mystartDate.getMonth() + 1; とします。
    startD = mystartDate.getDate(); にします。
    let begindate = startY + "-" + (startM < 10 ? "0" + startM : startM) + "-" + (startD < 10 ? "0" + startD : startD); 
    this.$set(this.searchTime, "range", [開始日,終了日]);
}、

this.$set---->時間選択ボックスに直接設定します

 必要に応じてデフォルトの表示日付範囲を変更します。

おすすめ

転載: blog.csdn.net/Humor_L/article/details/125441758