Kaynağa Gözat

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

cinwell.li 8 yıl önce
ebeveyn
işleme
066eaf123e
1 değiştirilmiş dosya ile 2 ekleme ve 0 silme
  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 {