<el-form-item label="公告时间" prop="formSetDate" v-if="isPopUpShow&&announceTypeShow&&ifPopUpShow&&isTimeShow">
<el-date-picker
ref="datetimerange"
v-model="formSetDate"
start-placeholder="开始日期"
end-placeholder="结束日期"
type="datetimerange"
value-format="yyyy-MM-dd HH:mm:ss"
format="MM-dd HH:mm"
:default-time="['00:00:00','23:59:59']"
:picker-options="pickerOptions"
>
</el-date-picker>
</el-form-item>
data里面设置一下
//日期当前时间(当前日期之前不可选)
pickerOptions: {
disabledDate(time) {
return time.getTime() < Date.now() - 24 * 60 * 60 * 1000 + 1;
}
},
网友评论