主要用到了这个 属性 picker-options
<el-date-picker
v-model="formAdd.retrDate"
type="date"
placeholder="选择日期"
:picker-options="pickerOptions"
clearable
/>
data(){
return{
formAdd: {
retrDate: "",
},
pickerOptions: {
disabledDate: (time) => {
return this.dealDisabledDate(time);
}
}
}
}
methods:{
dealDisabledDate(time) {
let strDate = new Date().toLocaleDateString();
let times = new Date(strDate).getTime();
return time.getTime() < times;
}
}
网友评论