el-date-picker 设置当前时间之后的选择区间

el-date-picker 设置当前时间之后的选择区间

<el-date-picker v-model="pickerDate" type="datetime" placeholder="请选时间" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd HH:mm:ss" :picker-options="pickerOptions">
</el-date-picker>
<script>
export default {
data() {
    return {
    	pickerDate:'',
    	endDateTime:'',//此值为设置结束的日期,根据自己的需求设置
		pickerOptions:{
			disabledDate: (time) => {
          return time.getTime() > new Date(this.endDateTime).getTime()|| (time.getTime() < Date.now() - 8.64e7)
        }
		}
	}
},

}

</script>

你可能感兴趣的:(javascript,vue.js,html)