Skip to content

Can antdv 2.x button components support router api #3863

@techrex

Description

@techrex
  • I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

经常会遇到点击按钮然后路由到某个页面的需求
如果按钮组件能够生成带有vue-router的超链接的a标签,就不需要用点击事件来路由了,尤其是要在新的页面中打开时
用a标签来路由对于SEO也更友好

What does the proposed API look like?

iview的button就支持这个组件,可以参考https://www.iviewui.com/components/button#API

  1. to 跳转的链接,支持 vue-router 对象 String | Object -
  2. replace 路由跳转时,开启 replace 将不会向 history 添加新记录 Boolean false
  3. target 相当于 a 链接的 target 属性 String _self

最好能在target是_blank的时候,添加rel="noopener"的属性,增加安全性

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions