Input: hide clear button when readonly (#10998)

pull/11008/merge
杨奕 2018-05-03 19:20:25 +08:00 committed by GitHub
parent dd773b9e72
commit d304cb27cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -196,7 +196,11 @@
return this.$slots.prepend || this.$slots.append;
},
showClear() {
return this.clearable && !this.disabled && this.currentValue !== '' && (this.focused || this.hovering);
return this.clearable &&
!this.disabled &&
!this.readonly &&
this.currentValue !== '' &&
(this.focused || this.hovering);
}
},