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(Anchor): allow replacing in anchor #43006
feat(Anchor): allow replacing in anchor #43006
Conversation
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.
Can you provide a test case to test it?
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## feature #43006 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 649 650 +1
Lines 10936 10956 +20
Branches 2965 2971 +6
=========================================
+ Hits 10936 10956 +20
☔ View full report in Codecov by Sentry. |
Co-authored-by: kiner-tang(文辉) <1127031143@qq.com>
Co-authored-by: kiner-tang(文辉) <1127031143@qq.com>
Co-authored-by: kiner-tang(文辉) <1127031143@qq.com>
Co-authored-by: kiner-tang(文辉) <1127031143@qq.com>
The coverage is down, need fix it. |
It's because of the default |
Co-authored-by: kiner-tang(文辉) <1127031143@qq.com>
Co-authored-by: kiner-tang(文辉) <1127031143@qq.com>
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
💡 Background and solution
The Anchor component should allow user to replace each item's href in browser history, because there are situations where we need a back button to take user to previous page, but currently when user clicks the back button he's sent back to the previous selected item in Anchor.
📝 Changelog
replace
propreplace
属性☑️ Self-Check before Merge
🚀 Summary
🤖 Generated by Copilot at 343684e
Added a new
replace
feature to theAnchor
andAnchorLink
components to allow users to choose the history mode for the anchor navigation. Updated the documentation and demo code in both English and Chinese languages to reflect the new feature. Reordered some imports to follow the code style guidelines.🔍 Walkthrough
🤖 Generated by Copilot at 343684e
replace
prop toAnchor
andAnchorLink
components to control history behavior (link, link, link, link, link, link)handleClick
function inAnchorLink
component to usewindow.location.replace
method ifreplace
is true (link)replace.md
andreplace.tsx
files to provide documentation and code example for the new feature (link, link)index.en-US.md
andindex.zh-CN.md
files to include the new feature in theExamples
,Anchor Props
andAnchorItem
sections (link, link, link, link, link, link)Anchor.tsx
andAnchorLink.tsx
files to follow code style guidelines (link, link)