-
-
Notifications
You must be signed in to change notification settings - Fork 52.1k
feat: add BackTop duration #25254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add BackTop duration #25254
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit b2820c0:
|
@@ -68,9 +69,10 @@ const BackTop: React.FC<BackTopProps> = props => { | |||
}; | |||
|
|||
const scrollToTop = (e: React.MouseEvent<HTMLDivElement>) => { | |||
const { onClick, target } = props; | |||
const { onClick, target, duration = 450 } = props; | |||
scrollTo(0, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个 0 要不要也提出来,可以设置 回到的位置
/rebase |
41e22d8
to
b2820c0
Compare
这个的 文档 API 我 补到 feature 还是 master ? @afc163 |
feature 吧 |
* docs: add 4.3.6 changelog * add 25244 changelog * fix review * update changelog * update changelog * Update CHANGELOG.en-US.md Co-authored-by: xrkffgg <xrkffgg@gmail.com> * Update CHANGELOG.en-US.md Co-authored-by: xrkffgg <xrkffgg@gmail.com> * Update CHANGELOG.en-US.md Co-authored-by: xrkffgg <xrkffgg@gmail.com> * Update CHANGELOG.en-US.md Co-authored-by: 偏右 <afc163@gmail.com> * sort log * Update CHANGELOG.zh-CN.md Co-authored-by: 偏右 <afc163@gmail.com> * update changelog * sort log * sort log * add #25266 #25243 #25254 #25271 changelog * add #25273 changelog * Update CHANGELOG.en-US.md Co-authored-by: xrkffgg <xrkffgg@gmail.com> * Update CHANGELOG.zh-CN.md Co-authored-by: 偏右 <afc163@gmail.com> * sort logs * Update CHANGELOG.zh-CN.md Co-authored-by: xrkffgg <xrkffgg@gmail.com> * up versin * Update changelog * close react/no-unused-prop-types * update changelog * update snapshot * Update CHANGELOG.en-US.md Co-authored-by: 偏右 <afc163@gmail.com> * update snapshot * Update CHANGELOG.zh-CN.md Co-authored-by: 偏右 <afc163@gmail.com> * update changelog * clear Duplicate * sort logs Co-authored-by: xrkffgg <xrkffgg@gmail.com> Co-authored-by: 偏右 <afc163@gmail.com>
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
fix #25251
💡 Background and solution
📝 Changelog
duration
used to set the time required to return to the top.duration
用来设置回到顶部所需时间。☑️ Self Check before Merge