1.0.0.0723
1.新增大数据量渲染测试 2.调整关闭下拉框时 滚动条返回顶部
This commit is contained in:
@@ -9,6 +9,7 @@ class General extends Component{
|
||||
super(options);
|
||||
this.searchCid = 0;
|
||||
this.setState({ searchVal: '', });
|
||||
this.viewRef = null;
|
||||
}
|
||||
|
||||
optionClick(item, selected, disabled, e){
|
||||
@@ -28,10 +29,17 @@ class General extends Component{
|
||||
|
||||
componentWillReceiveProps(props){
|
||||
if(!props.show){
|
||||
this.setState({ searchVal: '', })
|
||||
//清空输入框的值
|
||||
this.setState({ searchVal: '', });
|
||||
this.goTop();
|
||||
}
|
||||
}
|
||||
|
||||
goTop(){
|
||||
//返回顶部
|
||||
this.viewRef.scrollIntoView(true);
|
||||
}
|
||||
|
||||
render({ data, prop, template, theme, sels, empty, filterable, filterMethod, delay, searchTips }) {
|
||||
|
||||
const { name, value, disabled } = prop;
|
||||
@@ -67,8 +75,12 @@ class General extends Component{
|
||||
</div>
|
||||
);
|
||||
|
||||
|
||||
const onRef = (ref) => {
|
||||
this.viewRef = ref;
|
||||
};
|
||||
return (
|
||||
<div>
|
||||
<div ref={ onRef }>
|
||||
{ search }
|
||||
<div>{ arr }</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user