feat: tabsTransfer tab title 支持模版 (#6614)

This commit is contained in:
liaoxuezhi 2023-04-19 19:14:56 +08:00 committed by GitHub
parent 1bd375cc2f
commit 1bdb4645b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -1,5 +1,5 @@
import React from 'react';
import {autobind} from 'amis-core';
import {autobind, createObject, filter} from 'amis-core';
import Tabs, {Tab} from './Tabs';
import InputBox from './InputBox';
import TableCheckboxes from './TableSelection';
@ -256,7 +256,8 @@ export class TabsTransfer extends React.Component<
placeholder,
activeKey,
classnames: cx,
translate: __
translate: __,
data
} = this.props;
const showOptions = options.filter(item => item.visible !== false);
@ -279,7 +280,10 @@ export class TabsTransfer extends React.Component<
<Tab
eventKey={index}
key={index}
title={option.label || option.title}
title={filter(
option.label || option.title,
createObject(data, option)
)}
className="TabsTransfer-tab"
>
{option.searchable ? (

View File

@ -1247,7 +1247,7 @@ export class TreeSelector extends React.Component<
return (
<li
key={item[valueField]}
key={`${item[valueField || 'value']}-${index}`}
className={cx(`Tree-item ${itemClassName || ''}`, {
'Tree-item--isLeaf': isLeaf,
'is-child': this.relations.get(item)