Explorar o código

Input: hide clear button when readonly (#10998)

杨奕 %!s(int64=7) %!d(string=hai) anos
pai
achega
d304cb27cf
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      packages/input/src/input.vue

+ 5 - 1
packages/input/src/input.vue

@@ -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);
       }
     },