Skip to content

Commit

Permalink
fix(table): ensure that editable cell values are echoed correctly close
Browse files Browse the repository at this point in the history
  • Loading branch information
anncwb committed Mar 11, 2021
1 parent e15737b commit fab7a6c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion mock/demo/select-demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const demoList = (() => {
export default [
{
url: '/basic-api/select/getDemoOptions',
timeout: 4000,
timeout: 2000,
method: 'get',
response: ({ query }) => {
console.log(query);
Expand Down
9 changes: 5 additions & 4 deletions src/components/Table/src/components/editable/EditableCell.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
:popoverVisible="getRuleVisible"
:rule="getRule"
:ruleMessage="ruleMessage"
allowClear
size="small"
ref="elRef"
@change="handleChange"
Expand Down Expand Up @@ -183,14 +182,16 @@
async function handleChange(e: any) {
const component = unref(getComponent);
if (e?.target && Reflect.has(e.target, 'value')) {
if (!e) {
currentValueRef.value = e;
} else if (e?.target && Reflect.has(e.target, 'value')) {
currentValueRef.value = (e as ChangeEvent).target.value;
}
if (component === 'Checkbox') {
} else if (component === 'Checkbox') {
currentValueRef.value = (e as ChangeEvent).target.checked;
} else if (isString(e) || isBoolean(e) || isNumber(e)) {
currentValueRef.value = e;
}
table.emit?.('edit-change', {
column: props.column,
value: unref(currentValueRef),
Expand Down

0 comments on commit fab7a6c

Please sign in to comment.