fix:优化filterBar组件,点击document关闭状态菜单悬浮框
This commit is contained in:
parent
c69a2a5b7f
commit
4c6765925b
|
@ -31,7 +31,10 @@ export default class filterSelect extends React.Component {
|
||||||
this.setState({ menuShow: isShow });
|
this.setState({ menuShow: isShow });
|
||||||
}
|
}
|
||||||
mouseLeaveFn(){
|
mouseLeaveFn(){
|
||||||
this.setState({ menuShow: false });
|
window.document.addEventListener('click',()=>{
|
||||||
|
this.setState({ menuShow:false});
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
mouseMenuFn(){
|
mouseMenuFn(){
|
||||||
this.setState({ menuShow: true });
|
this.setState({ menuShow: true });
|
||||||
|
@ -88,7 +91,7 @@ export default class filterSelect extends React.Component {
|
||||||
this.onHandlerClick();
|
this.onHandlerClick();
|
||||||
}}
|
}}
|
||||||
onMouseEnter={()=>this.mouseMenuFn()}
|
onMouseEnter={()=>this.mouseMenuFn()}
|
||||||
// onMouseLeave={()=>this.mouseLeaveFn()}
|
onMouseLeave={()=>this.mouseLeaveFn()}
|
||||||
>
|
>
|
||||||
<span className="filter-label">{this.state.label}</span>
|
<span className="filter-label">{this.state.label}</span>
|
||||||
<span className="filter-maohao">:</span>
|
<span className="filter-maohao">:</span>
|
||||||
|
|
Loading…
Reference in New Issue