优化时间选择

wp1.0
fanluyan 2 years ago
parent 4b33b2fb93
commit 70df922e2a

@ -23,6 +23,7 @@
format="yyyy 年 MM 月 dd 日" format="yyyy 年 MM 月 dd 日"
:picker-options="pickerOptions" :picker-options="pickerOptions"
@change="changedate" @change="changedate"
@focus="handleDateFocus"
:clearable="false" :clearable="false"
> >
</el-date-picker> </el-date-picker>
@ -205,6 +206,15 @@ export default {
collectCourses() { collectCourses() {
this.collect = !this.collect; this.collect = !this.collect;
}, },
//focus
handleDateFocus() {
// pickerOptionsdisabledDate
this.pickerOptions.disabledDate = (date) => {
//console.log(date);
const currentDate = new Date();
return date.getTime() > currentDate.getTime(); //
};
},
// //
changedate() { changedate() {
console.log(this.dateValue.getTime()); console.log(this.dateValue.getTime());

Loading…
Cancel
Save