mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:39:05 +08:00
fix: 修复选项类控件 placeholder 没有被翻译的问题 (#5336)
This commit is contained in:
parent
b0fb1f402b
commit
00805c8d6c
@ -1271,7 +1271,8 @@ export function registerOptionsControl(config: OptionsConfig) {
|
||||
pathSeparator,
|
||||
delimiter = ',',
|
||||
labelField = 'label',
|
||||
valueField = 'value'
|
||||
valueField = 'value',
|
||||
translate: __
|
||||
} = this.props;
|
||||
|
||||
const {nodePathArray, nodeValueArray} = normalizeNodePath(
|
||||
@ -1286,6 +1287,7 @@ export function registerOptionsControl(config: OptionsConfig) {
|
||||
return (
|
||||
<Control
|
||||
{...this.props}
|
||||
placeholder={__(this.props.placeholder)}
|
||||
ref={this.inputRef}
|
||||
options={formItem ? formItem.filteredOptions : []}
|
||||
onToggle={this.handleToggle}
|
||||
|
@ -49,7 +49,12 @@ export class BaseSelection<
|
||||
S = any
|
||||
> extends React.Component<T, S> {
|
||||
static itemRender(option: Option, states: ItemRenderStates) {
|
||||
return <span>{option.label}</span>;
|
||||
return (
|
||||
<span>
|
||||
{option.label}
|
||||
{option.tip || ''}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
static defaultProps = {
|
||||
|
Loading…
Reference in New Issue
Block a user