feat: Tabs组件title支持schema

This commit is contained in:
sqzhou 2023-06-19 20:14:04 +08:00
parent f48b88abe1
commit 1b09b97d78

View File

@ -709,14 +709,14 @@ export default class Tabs extends React.Component<TabsProps, TabsState> {
// 渲染tabs的title
renderTabTitle(
title: string | SchemaNode | undefined,
title: string | SchemaObject | undefined,
index: number,
data: any
) {
const {render} = this.props;
return isObject(title) && title
? render(`tab-title/${index}`, title, data)
: filter(title, data);
return typeof title === 'string' || !title
? filter(title, data)
: render(`tab-title/${index}`, title, data);
}
renderToolbar() {