mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2026-07-25 12:05:24 +08:00
16 lines
490 B
TypeScript
16 lines
490 B
TypeScript
import type { ColumnConfig } from './schema';
|
|
|
|
export const resolveComponentProps = (config: ColumnConfig, row: any, index: number) => {
|
|
if (typeof config.props === 'function') {
|
|
return config.props(row, index) || {};
|
|
}
|
|
return config.props || {};
|
|
};
|
|
|
|
export const resolveComponentListeners = (config: ColumnConfig, row: any, index: number) => {
|
|
if (typeof config.listeners === 'function') {
|
|
return config.listeners(row, index) || {};
|
|
}
|
|
return config.listeners || {};
|
|
};
|