Browse Source

fix(table): `size` not worked in `editComponentProps`

修复无法设置basicTable编辑组件的size属性的问题

fixed: #1074
无木 3 years ago
parent
commit
7971896383

+ 1 - 0
CHANGELOG.zh_CN.md

@@ -14,6 +14,7 @@
   - 修复 selection-change 事件在取消勾选时未能正确触发的问题
   - 修复浅色主题下的全屏状态背景颜色不正确的问题
   - 修复`getSelectRows`不支持远程数据跨页选择时获取完整数据的问题
+  - 修复在`editComponentProps`中为编辑组件提供的`size`属性无效的问题
 - **Qrcode** 修复二维码组件在创建时未能及时绘制的问题
 - **BasicModal** 修复`helpMessage`属性不起作用的问题
 

+ 7 - 3
src/components/Table/src/components/editable/EditableCell.vue

@@ -20,14 +20,13 @@
         :rule="getRule"
         :ruleMessage="ruleMessage"
         :class="getWrapperClass"
-        size="small"
         ref="elRef"
         @change="handleChange"
         @options-change="handleOptionsChange"
         @pressEnter="handleEnter"
       />
       <div :class="`${prefixCls}__action`" v-if="!getRowEditable">
-        <CheckOutlined :class="[`${prefixCls}__icon`, 'mx-2']" @click="handleSubmit" />
+        <CheckOutlined :class="[`${prefixCls}__icon`, 'mx-2']" @click="handleSubmitClick" />
         <CloseOutlined :class="`${prefixCls}__icon `" @click="handleCancel" />
       </div>
     </div>
@@ -112,6 +111,7 @@
         const value = isCheckValue ? (isNumber(val) && isBoolean(val) ? val : !!val) : val;
 
         return {
+          size: 'small',
           getPopupContainer: () => unref(table?.wrapRef.value) ?? document.body,
           getCalendarContainer: () => unref(table?.wrapRef.value) ?? document.body,
           placeholder: createPlaceholderMessage(unref(getComponent)),
@@ -259,6 +259,10 @@
         handleSubmit();
       }
 
+      function handleSubmitClick() {
+        handleSubmit();
+      }
+
       function handleCancel() {
         isEdit.value = false;
         currentValueRef.value = defaultValueRef.value;
@@ -363,7 +367,7 @@
         getRowEditable,
         getValues,
         handleEnter,
-        // getSize,
+        handleSubmitClick,
       };
     },
   });