소스 검색

DatePicker: fix prevent clear value when readonly is true, fixed #1238 (#1326)

cinwell.li 8 년 전
부모
커밋
066eaf123e
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      packages/date-picker/src/picker.vue

+ 2 - 0
packages/date-picker/src/picker.vue

@@ -328,12 +328,14 @@ export default {
 
   methods: {
     handleMouseEnterIcon() {
+      if (this.readonly || this.disabled) return;
       if (!this.valueIsEmpty) {
         this.showClose = true;
       }
     },
 
     handleClickIcon() {
+      if (this.readonly || this.disabled) return;
       if (this.valueIsEmpty) {
         this.pickerVisible = !this.pickerVisible;
       } else {