Commit 64533f6204f96f79c6006d9911e9417cd9800d0d

Authored by vben
1 parent 759e5320

fix(table): fix the table in the editable row status and press Enter to confirm #258

CHANGELOG.zh_CN.md
... ... @@ -11,6 +11,7 @@
11 11 - 修复代码 debugger 位置显示错误
12 12 - 修复 mock 插件 post 请求错误问题
13 13 - 修复部分主题颜色值错误
  14 +- 修复表格在可编辑行状态回车确认
14 15  
15 16 ### 🎫 Chores
16 17  
... ...
src/components/Table/src/components/editable/EditableCell.vue
... ... @@ -17,7 +17,7 @@
17 17 ref="elRef"
18 18 @change="handleChange"
19 19 @options-change="handleOptionsChange"
20   - @pressEnter="handleSubmit"
  20 + @pressEnter="handleEnter"
21 21 />
22 22 <div :class="`${prefixCls}__action`" v-if="!getRowEditable">
23 23 <CheckOutlined :class="[`${prefixCls}__icon`, 'mx-2']" @click="handleSubmit" />
... ... @@ -234,6 +234,13 @@
234 234 isEdit.value = false;
235 235 }
236 236  
  237 + async function handleEnter() {
  238 + if (props.column?.editRow) {
  239 + return;
  240 + }
  241 + handleSubmit();
  242 + }
  243 +
237 244 function handleCancel() {
238 245 isEdit.value = false;
239 246 currentValueRef.value = defaultValueRef.value;
... ... @@ -311,6 +318,7 @@
311 318 getWrapperStyle,
312 319 getRowEditable,
313 320 getValues,
  321 + handleEnter,
314 322 // getSize,
315 323 };
316 324 },
... ...