|
@@ -26,11 +26,14 @@ class MedicalInfo extends Component {
|
|
|
});
|
|
|
}
|
|
|
search(){
|
|
|
+ console.log('val1')
|
|
|
const {handleChangeValue} = this.props;
|
|
|
const val = this.$inp.current.value;
|
|
|
+ console.log('val',val)
|
|
|
handleChangeValue&&handleChangeValue(val);
|
|
|
}
|
|
|
handleChange(){
|
|
|
+ console.log('change')
|
|
|
this.setState({
|
|
|
val:this.$inp.current.value
|
|
|
});
|
|
@@ -59,7 +62,7 @@ class MedicalInfo extends Component {
|
|
|
<div className={style['search-cont']}>
|
|
|
<p className={style['title']}>医学知识搜索</p>
|
|
|
<p className={style['cont']}>
|
|
|
- <input type="text" className={style['input']} ref={this.$inp} onChange={this.handleChange}/>
|
|
|
+ <input type="text" className={style['input']} ref={this.$inp} />
|
|
|
{val?<img src={delIcon} alt="清空" onClick={this.clear}/>:''}
|
|
|
<button onClick={this.search}>搜索</button>
|
|
|
</p>
|