element 地址:
/#/zh-CN/component/date-picker
组件中使用
<template><div><el-date-pickerv-model="value1"type="date"value-format="yyyy-MM-dd":picker-options="pickerOptions"></el-date-picker></div></template><script>export default {data() {return {value1: "",pickerOptions: {disabledDate(date) {// -07-11 至 -07-13 禁选,返回true代表禁用if (date.getTime() > new Date("-07-10") &&date.getTime() < new Date("-07-13")) {return true;}// 设置过去时间不可选,返回true代表禁用//let zero=new Date().setHours(0, 0, 0, 0);//if(date.getTime()<zero){// return true;//}return false;},},};},};</script><style scoped></style>
效果图: