Commit 64533f6204f96f79c6006d9911e9417cd9800d0d
1 parent
759e5320
fix(table): fix the table in the editable row status and press Enter to confirm #258
Showing
2 changed files
with
10 additions
and
1 deletions
CHANGELOG.zh_CN.md
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 | }, |