mirror of
https://github.com/ant-design/ant-design.git
synced 2025-07-31 20:36:35 +08:00
commit
af29df4238
@ -57,13 +57,6 @@ export default class BackTop extends React.Component {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
animationEnd = () => {
|
|
||||||
const scrollTop = getScroll(window, true);
|
|
||||||
this.setState({
|
|
||||||
visible: scrollTop > this.props.visibilityHeight,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this.scrollEvent = addEventListener(window, 'scroll', this.handleScroll);
|
this.scrollEvent = addEventListener(window, 'scroll', this.handleScroll);
|
||||||
}
|
}
|
||||||
@ -92,17 +85,16 @@ export default class BackTop extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Animate
|
<Animate component="" transitionName="fade">
|
||||||
showProp="data-show"
|
{
|
||||||
transitionName="fade"
|
this.state.visible ?
|
||||||
onEnd={this.animationEnd}
|
<div data-show={this.state.visible} style={style}>
|
||||||
transitionAppear
|
<div {...restProps} className={classString} onClick={this.scrollToTop}>
|
||||||
>
|
{children || defaultElement}
|
||||||
<div data-show={this.state.visible} style={style}>
|
</div>
|
||||||
<div {...restProps} className={classString} onClick={this.scrollToTop}>
|
</div>
|
||||||
{children || defaultElement}
|
: null
|
||||||
</div>
|
}
|
||||||
</div>
|
|
||||||
</Animate>
|
</Animate>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user