html
<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']"
问题所在之处
解决方案
javascript
dateOptions(time) {
const end = new Date(new Date().toLocaleDateString());
end.setTime(end.getTime() + 3600 * 1000 * 24 - 1000);
return time.getTime() > end.getTime();
},