Browse Source

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

cinwell.li 8 years ago
parent
commit
066eaf123e
1 changed files with 2 additions and 0 deletions
  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 {