Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: crud2列标题支持表达式 #11399

Merged
merged 4 commits into from
Dec 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions packages/amis/src/renderers/Table2/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -894,17 +894,15 @@ export default class Table2 extends React.Component<Table2Props, object> {
const clone = {...column} as any;

let titleSchema: any = null;
const title = clone.title || clone.label;
const titleProps = {
popOverContainer: popOverContainer || this.getPopOverContainer,
value: column.title || column.label
...data,
popOverContainer: popOverContainer || this.getPopOverContainer
};
if (isObject(column.title)) {
titleSchema = cloneDeep(column.title);
} else if (
typeof column.title === 'string' ||
typeof column.label === 'string'
) {
titleSchema = {type: 'plain'};
} else if (typeof title === 'string') {
titleSchema = {type: 'plain', tpl: title};
}

if (column.align) {
Expand Down
Loading