浏览代码

Select: fix size attribute not working (#13070)

hetech 6 年之前
父节点
当前提交
ef397572da
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      packages/select/src/select.vue

+ 6 - 1
packages/select/src/select.vue

@@ -854,7 +854,12 @@
 
       const reference = this.$refs.reference;
       if (reference && reference.$el) {
-        this.initialInputHeight = reference.$el.getBoundingClientRect().height;
+        const sizeMap = {
+          medium: 36,
+          small: 32,
+          mini: 28
+        };
+        this.initialInputHeight = reference.$el.getBoundingClientRect().height || sizeMap[this.selectSize];
       }
       if (this.remote && this.multiple) {
         this.resetInputHeight();