element UI之 el-date-picker 无法选择当前日期

<el-date-picker
   class="picker"
   v-model="starttime"
   style="height: 28px; width: 260px"
   type="daterange"
   unlink-panels
   size="mini"
   value-format="yyyy-MM-dd HH:mm:ss"
   align="right"
   start-placeholder="开始日期"
   end-placeholder="结束日期"
   :default-time="['00:00:00', '23:59:59']"
   :picker-options="{ disabledDate: dateOptions }"
 >
 el-date-picker>

:default-time="['00:00:00', '23:59:59']"问题所在之处

解决方案

dateOptions(time) {
  const end = new Date(new Date().toLocaleDateString());
   end.setTime(end.getTime() + 3600 * 1000 * 24 - 1000);
   return time.getTime() > end.getTime();
 },

你可能感兴趣的:(element,UI,前端,elementui)