|
@@ -14,7 +14,7 @@
|
|
|
<div
|
|
|
:class="[
|
|
|
'el-input el-input--small el-input--suffix',
|
|
|
- { 'is-focus': isFocus },
|
|
|
+ { 'is-focus': isFocus, 'is-disabled': disabled },
|
|
|
]"
|
|
|
@mouseenter="inputHovering = true"
|
|
|
@mouseleave="inputHovering = false"
|
|
@@ -26,6 +26,7 @@
|
|
|
:placeholder="placeholder"
|
|
|
class="el-input__inner"
|
|
|
:value="selectedOrg.name"
|
|
|
+ :disabled="disabled"
|
|
|
readonly
|
|
|
/>
|
|
|
<span class="el-input__suffix">
|
|
@@ -128,10 +129,11 @@ export default {
|
|
|
},
|
|
|
computed: {
|
|
|
showClose() {
|
|
|
- let hasValue = this.multiple
|
|
|
+ const hasValue = this.multiple
|
|
|
? Array.isArray(this.value) && this.value.length > 0
|
|
|
: this.value !== undefined && this.value !== null && this.value !== "";
|
|
|
- let criteria = this.clearable && this.inputHovering && hasValue;
|
|
|
+ const criteria =
|
|
|
+ this.clearable && this.inputHovering && hasValue && !this.disabled;
|
|
|
return criteria;
|
|
|
},
|
|
|
},
|
|
@@ -159,6 +161,7 @@ export default {
|
|
|
if (this.value) this.initSelected(this.value);
|
|
|
},
|
|
|
switchOpen() {
|
|
|
+ if (this.disabled) return;
|
|
|
if (this.visible) {
|
|
|
this.handleClose();
|
|
|
} else {
|