vue通过router.push
时间: 2023-09-14 21:12:23 浏览: 130
vue.js this.$router.push获取不到params参数问题
5星 · 资源好评率100%
在Vue中,通过使用`router.push()`方法可以实现路由的跳转。但是需要注意的是,在使用`router.push()`方法时,不能同时使用`path`和`params`参数,否则`params`将会无效。相反,可以通过在路由配置文件中定义`name`属性来指定页面,并通过`name`来实现页面的跳转。例如:`router.push({ name: 'pageName' })`。这样可以确保路由跳转的正确性。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [vue-router3.0版本中 router.push 不能刷新页面的问题](https://download.csdn.net/download/weixin_38715721/13206349)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [Vue中this.$router.push参数获取方法](https://download.csdn.net/download/weixin_38651273/13193399)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [系统基于springboot框架,使用Java+vue编写,为前后端分离的微服务项目](https://download.csdn.net/download/Abelon/88250447)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文