js日期1 el-date-picker日期范围
作者:互联网
<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()
);
}
}
标签:picker,el,return,getTime,getFullYear,Date,日期,date,new 来源: https://www.cnblogs.com/linhan8888/p/15158357.html