this.$router.push死循环
时间: 2023-09-28 11:06:53 浏览: 168
问题中提到了使用this.$router.push()方法跳转页面出现死循环的情况。根据引用和引用的内容,可以看出可能是因为在引入router时使用了this.$router.push()方法导致的问题。正确的做法是使用import router from "@/router"引入router,并使用router.push()方法进行页面跳转。例如:router.push({path:'/home'})。这样就能解决死循环的问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [Vue中this.$router.push()失效解决办法](https://blog.csdn.net/weixin_45912825/article/details/117752515)[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^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *3* [解决vue.js this.$router.push无效的问题](https://download.csdn.net/download/weixin_38738506/12952852)[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^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文