router-link>
标签来代替<a href="...">
<router-link tag="li" to="/foo">测试</router-link>
props | 类型 | 默认 | 描述 |
---|---|---|---|
to | string | 必须填写 | 跳转链接,内部会立刻把 to 的值传到 router.push() |
replace | boolean | false | 会调用 router.replace() 而不是 router.push(),于是导航后不会留下 history 记录 |
append | boolean | false | 我们从 /a 导航到一个相对路径 b,如果没有配置 append,则路径为 /b,如果配了,则为 /a/b |
tag | string | “a” | <router-link> 渲染成某种标签 |
active-class | string | “router-link-active” | 激活时,css的样式 |
exact | |||
event | |||
exact-active-class |