this.$router.push 会刷新
时间: 2023-10-17 11:26:27 浏览: 97
this.$router.push方法不会刷新页面。它会更改URL并导航到指定的路由,但不会触发页面的刷新。所以当你使用this.$router.push进行页面跳转时,页面不会随之刷新。如果你希望在路由参数有变化时刷新当前路由,可以在App.vue中的router-view标签设置key值,或使用监听器watch来实现。<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_1"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [vue之this.$router.push页面刷新问题](https://blog.csdn.net/weixin_47800450/article/details/112167359)[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_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文