|
@@ -3,7 +3,7 @@
|
|
|
class="el-date-editor"
|
|
|
:class="'el-date-editor--' + type"
|
|
|
:readonly="!editable || readonly"
|
|
|
- :disabled="disabled"
|
|
|
+ :disabled="pickerDisabled"
|
|
|
:size="pickerSize"
|
|
|
:id="id"
|
|
|
:name="name"
|
|
@@ -32,7 +32,7 @@
|
|
|
:class="[
|
|
|
'el-date-editor--' + type,
|
|
|
pickerSize ? `el-range-editor--${ pickerSize }` : '',
|
|
|
- disabled ? 'is-disabled' : '',
|
|
|
+ pickerDisabled ? 'is-disabled' : '',
|
|
|
pickerVisible ? 'is-active' : ''
|
|
|
]"
|
|
|
@click="handleRangeClick"
|
|
@@ -46,7 +46,7 @@
|
|
|
<input
|
|
|
:placeholder="startPlaceholder"
|
|
|
:value="displayValue && displayValue[0]"
|
|
|
- :disabled="disabled"
|
|
|
+ :disabled="pickerDisabled"
|
|
|
:id="id && id[0]"
|
|
|
:readonly="!editable || readonly"
|
|
|
:name="name && name[0]"
|
|
@@ -58,7 +58,7 @@
|
|
|
<input
|
|
|
:placeholder="endPlaceholder"
|
|
|
:value="displayValue && displayValue[1]"
|
|
|
- :disabled="disabled"
|
|
|
+ :disabled="pickerDisabled"
|
|
|
:id="id && id[1]"
|
|
|
:readonly="!editable || readonly"
|
|
|
:name="name && name[1]"
|
|
@@ -298,6 +298,9 @@ export default {
|
|
|
mixins: [Emitter, NewPopper],
|
|
|
|
|
|
inject: {
|
|
|
+ elForm: {
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
elFormItem: {
|
|
|
default: ''
|
|
|
}
|
|
@@ -364,7 +367,7 @@ export default {
|
|
|
|
|
|
watch: {
|
|
|
pickerVisible(val) {
|
|
|
- if (this.readonly || this.disabled) return;
|
|
|
+ if (this.readonly || this.pickerDisabled) return;
|
|
|
if (val) {
|
|
|
this.showPicker();
|
|
|
this.valueOnOpen = this.value;
|
|
@@ -481,6 +484,10 @@ export default {
|
|
|
|
|
|
pickerSize() {
|
|
|
return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
|
|
|
+ },
|
|
|
+
|
|
|
+ pickerDisabled() {
|
|
|
+ return this.disabled || (this.elForm || {}).disabled;
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -537,7 +544,7 @@ export default {
|
|
|
},
|
|
|
|
|
|
handleMouseEnter() {
|
|
|
- if (this.readonly || this.disabled) return;
|
|
|
+ if (this.readonly || this.pickerDisabled) return;
|
|
|
if (!this.valueIsEmpty && this.clearable) {
|
|
|
this.showClose = true;
|
|
|
}
|
|
@@ -604,7 +611,7 @@ export default {
|
|
|
},
|
|
|
|
|
|
handleClickIcon(event) {
|
|
|
- if (this.readonly || this.disabled) return;
|
|
|
+ if (this.readonly || this.pickerDisabled) return;
|
|
|
if (this.showClose) {
|
|
|
event.stopPropagation();
|
|
|
this.emitInput(null);
|