router-link to怎么设置不跳转页面
时间: 2023-11-07 18:19:20 浏览: 164
你可以通过设置to属性为当前页面的路径来实现不跳转页面。例如,如果你希望当前页路径是"/detail",你可以将to属性设置为"/detail"。这样,当你点击这个router-link时,页面不会发生跳转,但是其他与router-link相关的操作,如激活状态等,仍然会生效。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [Vue 页面跳转不用router-link的实现代码](https://download.csdn.net/download/weixin_38671628/12761288)[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: 50%"]
- *2* *3* [【Vue项目练习】router-link跳转失败原因](https://blog.csdn.net/xptxhx/article/details/127786820)[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: 50%"]
[ .reference_list ]
阅读全文