|
@@ -10,7 +10,8 @@ class ScaleSearch extends Component {
|
|
|
this.$cont = React.createRef();
|
|
|
this.state={
|
|
|
val:'',
|
|
|
- hasSearch: false
|
|
|
+ hasSearch: false,
|
|
|
+ msg:''
|
|
|
};
|
|
|
this.search = this.search.bind(this);
|
|
|
this.handleChange = this.handleChange.bind(this);
|
|
@@ -46,7 +47,8 @@ class ScaleSearch extends Component {
|
|
|
search(){
|
|
|
if(this.state.hasSearch === false){
|
|
|
this.setState({
|
|
|
- hasSearch: true
|
|
|
+ hasSearch: true,
|
|
|
+ msg:'暂无搜索结果!'
|
|
|
})
|
|
|
}
|
|
|
const {handleChangeValue} = this.props;
|
|
@@ -68,7 +70,8 @@ class ScaleSearch extends Component {
|
|
|
this.$inp.current.value = '';
|
|
|
this.setState({
|
|
|
val:'',
|
|
|
- hasSearch: false
|
|
|
+ hasSearch: false,
|
|
|
+ msg:''
|
|
|
});
|
|
|
clearResult&&clearResult();
|
|
|
}
|
|
@@ -89,7 +92,7 @@ class ScaleSearch extends Component {
|
|
|
}
|
|
|
render() {
|
|
|
const {searchResult} = this.props;
|
|
|
- const {val, hasSearch} = this.state;
|
|
|
+ const {val, hasSearch,msg} = this.state;
|
|
|
return (
|
|
|
<div className={style['search-cont']} ref={this.$cont}>
|
|
|
<div className={style['search-box']}>
|
|
@@ -105,7 +108,7 @@ class ScaleSearch extends Component {
|
|
|
<ul>
|
|
|
{this.getSearchList()}
|
|
|
</ul>
|
|
|
- </div>:<p className={style['no-data']}>{hasSearch?'搜索中...':'暂无搜索结果!'}</p>}
|
|
|
+ </div>:<p className={style['no-data']}>{hasSearch?'搜索中...':msg}</p>}
|
|
|
</div>
|
|
|
)
|
|
|
|