Explorar el Código

Input: hide clear button when readonly (#10998)

杨奕 hace 7 años
padre
commit
d304cb27cf
Se han modificado 1 ficheros con 5 adiciones y 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);
       }
     },