浏览代码

Input: not show clear button when value is null (#10912)

杨奕 7 年之前
父节点
当前提交
27a8c1556e
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      packages/input/src/input.vue

+ 3 - 1
packages/input/src/input.vue

@@ -122,7 +122,9 @@
 
     data() {
       return {
-        currentValue: this.value === undefined ? '' : this.value,
+        currentValue: this.value === undefined || this.value === null
+          ? ''
+          : this.value,
         textareaCalcStyle: {},
         prefixOffset: null,
         suffixOffset: null,