<el-date-picker v-model="dataForm.jjDate" placeholder="奖惩时间" style="width:90%;" type="datetime"
:picker-options="expireTimeOption" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
data()的return里
expireTimeOption: {
disabledDate(date) {
//disabledDate 文档上:设置禁用状态,参数为当前日期,要求返回 Boolean
return (
date.getTime() < new Date(new Date().getFullYear(),0,1).getTime() ||
date.getTime() > new Date(new Date().getFullYear(),11,31).getTime()
);
}
}