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