//字符串(填写 routePath或者 /routePath)地址显示:/routePath
<router-link to="routePath">MyPage</router-link>
//以下为v-bind变量方式
//路由path跳转(填写 routePath或者 /routePath) 地址显示:/routePath?userId=123
<router-link :to="{ path: '/routePath', query: { userId: 123 }}">MyPage</router-link>
//路由name跳转(填写 routeName)地址显示:/routeName
<router-link :to="{ name: 'routeName ', params: { userId: 123 }}">MyPage</router-link>
【router-link】
最新推荐文章于 2024-01-20 18:30:06 发布
本文详细介绍了Vue中如何使用`router-link`组件进行页面跳转,包括通过`path`直接指定路径和通过`name`指定路由名称的方式,并展示了如何附加查询参数。无论你是初学者还是有经验的开发者,都能从中了解到Vue路由跳转的全面知识。
摘要由CSDN通过智能技术生成