fix(EditableCell): 修复可编辑表格 组件onChange重复问题 (#2495)
* fix: props 初始化拼写错误 defualt => default * fix: props 定义默认值拼写错误 defualt => default * fix(EditableCell): 修复可编辑表格select组件onChange重复问题 Co-authored-by: 苗大 <caoshengmiao@hypergryph.com>
This commit is contained in:
parent
7e77177ed8
commit
0cc53558fb
|
|
@ -77,6 +77,11 @@
|
|||
if (isFunction(compProps)) {
|
||||
compProps = compProps({ text: val, record, column, index }) ?? {};
|
||||
}
|
||||
|
||||
// 用临时变量存储 onChange方法 用于 handleChange方法 获取,并删除原始onChange, 防止存在两个 onChange
|
||||
compProps.onChangeTemp = compProps.onChange;
|
||||
delete compProps.onChange;
|
||||
|
||||
const component = unref(getComponent);
|
||||
const apiSelectProps: Recordable = {};
|
||||
if (component === 'ApiSelect') {
|
||||
|
|
@ -187,7 +192,7 @@
|
|||
} else if (isString(e) || isBoolean(e) || isNumber(e) || isArray(e)) {
|
||||
currentValueRef.value = e;
|
||||
}
|
||||
const onChange = unref(getComponentProps)?.onChange;
|
||||
const onChange = unref(getComponentProps)?.onChangeTemp;
|
||||
if (onChange && isFunction(onChange)) onChange(...arguments);
|
||||
|
||||
table.emit?.('edit-change', {
|
||||
|
|
@ -404,8 +409,7 @@
|
|||
column: this.column,
|
||||
index: this.index,
|
||||
})
|
||||
: (this.getValues ?? "\u00A0")
|
||||
}
|
||||
: this.getValues ?? '\u00A0'}
|
||||
</div>
|
||||
{!this.column.editRow && <FormOutlined class={`${this.prefixCls}__normal-icon`} />}
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue