mirror of https://github.com/ElemeFE/element
parent
a5e5be3d7a
commit
a1324324a2
|
@ -265,6 +265,11 @@
|
||||||
oldDate.setHours(hour);
|
oldDate.setHours(hour);
|
||||||
oldDate.setMinutes(minute);
|
oldDate.setMinutes(minute);
|
||||||
oldDate.setSeconds(second);
|
oldDate.setSeconds(second);
|
||||||
|
if (typeof this.disabledDate === 'function' && this.disabledDate(oldDate)) {
|
||||||
|
this.$refs.timepicker.disabled = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$refs.timepicker.disabled = false;
|
||||||
this.date = new Date(oldDate.getTime());
|
this.date = new Date(oldDate.getTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,8 @@
|
||||||
@click="handleCancel">{{ t('el.datepicker.cancel') }}</button>
|
@click="handleCancel">{{ t('el.datepicker.cancel') }}</button>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="el-time-panel__btn confirm"
|
class="el-time-panel__btn"
|
||||||
|
:class="{confirm: !disabled}"
|
||||||
@click="handleConfirm()">{{ t('el.datepicker.confirm') }}</button>
|
@click="handleConfirm()">{{ t('el.datepicker.confirm') }}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -101,7 +102,8 @@
|
||||||
currentDate: this.$options.defaultValue || this.date || new Date(),
|
currentDate: this.$options.defaultValue || this.date || new Date(),
|
||||||
currentVisible: this.visible || false,
|
currentVisible: this.visible || false,
|
||||||
width: this.pickerWidth || 0,
|
width: this.pickerWidth || 0,
|
||||||
selectionRange: [0, 2]
|
selectionRange: [0, 2],
|
||||||
|
disabled: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue