Browse Source

fix(textinput): 异步修改 value clear-btn不消失 #826

richard1015 3 years ago
parent
commit
c3944d912e
1 changed files with 6 additions and 0 deletions
  1. 6 0
      src/packages/textinput/textinput.vue

+ 6 - 0
src/packages/textinput/textinput.vue

@@ -80,6 +80,12 @@ export default {
       });
     }
   },
+  
+  watch:{
+    value(newVal,oldVal){
+     this.clearBtnShow = !!newVal;
+    }
+  },
 
   methods: {
     clear() {