소스 검색

Input: hide clear button when readonly (#10998)

杨奕 7 년 전
부모
커밋
d304cb27cf
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  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);
       }
     },