select noResultText 支持 Html 标签

This commit is contained in:
liaoxuezhi 2019-10-22 11:20:36 +08:00
parent ca0344567b
commit f4fcecf6b6

View File

@ -168,7 +168,7 @@ export default class SelectControl extends React.Component<SelectProps, any> {
}
render() {
const {
let {
autoComplete,
searchable,
options,
@ -184,9 +184,15 @@ export default class SelectControl extends React.Component<SelectProps, any> {
classnames,
creatable,
inline,
noResultsText,
render,
...rest
} = this.props;
if (noResultsText && /<\w+/.test(noResultsText)) {
noResultsText = render('noResultText', noResultsText);
}
return (
<div className={cx(`${classPrefix}SelectControl`, className)}>
<Select
@ -202,8 +208,7 @@ export default class SelectControl extends React.Component<SelectProps, any> {
searchable={autoComplete || creatable ? true : searchable}
onChange={this.changeValue}
loading={loading}
cache={false}
joinValues={false}
noResultsText={noResultsText}
/>
</div>
);