mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
input-text组件的placeholder属性支持表达式 #7426 判断空值逻辑中也执行filter表达式
This commit is contained in:
parent
76904e556b
commit
dbef91b952
@ -734,6 +734,8 @@ export default class TextControl extends React.PureComponent<
|
||||
});
|
||||
}
|
||||
|
||||
const filteredPlaceholder = filter(placeholder, data);
|
||||
|
||||
return (
|
||||
<div
|
||||
className={cx(
|
||||
@ -750,12 +752,12 @@ export default class TextControl extends React.PureComponent<
|
||||
onClick={this.handleClick}
|
||||
>
|
||||
<>
|
||||
{placeholder &&
|
||||
{filteredPlaceholder &&
|
||||
!selectedOptions.length &&
|
||||
!this.state.inputValue &&
|
||||
!this.state.isFocused ? (
|
||||
<div className={cx('TextControl-placeholder')}>
|
||||
{filter(placeholder, data)}
|
||||
{filteredPlaceholder}
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user