docs(Anchor): fix targetOffset prop doc of review change

This commit is contained in:
shao 2019-07-23 20:54:00 +08:00
parent b02e433226
commit b3537d5c38

View File

@ -269,7 +269,7 @@ export default class Anchor extends React.Component<AnchorProps, AnchorState> {
const { offsetTop, getContainer, targetOffset } = this.props as AnchorDefaultProps;
this.animating = true;
this.setState({ activeLink: link });
scrollTo(link, targetOffset || offsetTop || 0, getContainer, () => {
scrollTo(link, targetOffset !== undefined ? targetOffset : offsetTop, getContainer, () => {
this.animating = false;
});
};