Skip to content
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

[menu-item] 使用router-link(a标签)渲染to属性 #4542

Closed
Nero978 opened this issue Sep 8, 2024 · 3 comments
Closed

[menu-item] 使用router-link(a标签)渲染to属性 #4542

Nero978 opened this issue Sep 8, 2024 · 3 comments
Labels
📒 documentation Improvements or additions to documentation to be published to be published

Comments

@Nero978
Copy link
Contributor

Nero978 commented Sep 8, 2024

这个功能解决了什么问题

可以用href,href类型的会转换成a标签

为什么不将to的属性用于router-link呢(最终渲染为a标签)?使用div渲染menu-item失去了右键点击-新标签页打开等能力,对于SPA来说,用户就是期望能够控制导航、路由行为的页面打开方式,在某个特定的时候选择使用新标签页打开,而不是配置target之后总是以新标签页打开。

如果使用目前已有的href属性传递路径,那就完全失去了SPA应有的能力,每次导航浏览器都将重新完整请求一次页面,失去了组件的状态和响应性,页面上的部分icon也需要重新请求一次,视图会发生闪烁,基于vue router和transition实现的路由动画也将失效,这不是纯粹脱裤子放屁么?😅

你建议的方案是什么

直接默认将to属性用router-link实现吧

Copy link
Contributor

github-actions bot commented Sep 8, 2024

👋 @Nero978,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@boogie-ben
Copy link
Contributor

#3057

@Nero978
Copy link
Contributor Author

Nero978 commented Sep 9, 2024

#3057

感谢老哥!😀

@uyarn uyarn added 📒 documentation Improvements or additions to documentation to be published to be published labels Sep 9, 2024
@uyarn uyarn closed this as completed Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📒 documentation Improvements or additions to documentation to be published to be published
Projects
None yet
Development

No branches or pull requests

3 participants