<el-date-picker
v-model="value1"
type="datetime"
placeholder="选择开始时间"
:picker-options="pickerOptions0">
</el-date-picker>
<i class="el-icon-minus icon"></i>
<el-date-picker
v-model="value2"
type="datetime"
placeholder="选择结束时间"
:picker-options="pickerOptions1">
</el-date-picker>
data(){
return {
value1:'',
value2:'',
pickerOptions0: {
disabledDate: (time) => {
if (this.value2 != "") {
return time.getTime() > Date.now() || time.getTime() > this.value2;
} else {
return time.getTime() > Date.now();
}
}
},
pickerOptions1: {
disabledDate: (time) => {
return time.getTime() < this.value1 || time.getTime() > Date.now();
}
}
}
}