fix(table): editComponentProps support onChange

修复editComponentProps不支持onChange的问题
This commit is contained in:
无木 2021-06-28 16:27:53 +08:00
parent 3dbbde2662
commit 829b366cb2

View File

@ -44,7 +44,7 @@
import { propTypes } from '/@/utils/propTypes';
import { isString, isBoolean, isFunction, isNumber, isArray } from '/@/utils/is';
import { createPlaceholderMessage } from './helper';
import { set } from 'lodash-es';
import { set, omit } from 'lodash-es';
export default defineComponent({
name: 'EditableCell',
@ -108,7 +108,7 @@
return {
placeholder: createPlaceholderMessage(unref(getComponent)),
...apiSelectProps,
...compProps,
...omit(compProps, 'onChange'),
[valueField]: value,
};
});
@ -184,6 +184,8 @@
} else if (isString(e) || isBoolean(e) || isNumber(e)) {
currentValueRef.value = e;
}
const onChange = props.column?.editComponentProps?.onChange;
if (onChange && isFunction(onChange)) onChange(...arguments);
table.emit?.('edit-change', {
column: props.column,