vue 子路由不写router view可以显示吗_对 router-view 的理解
时间: 2023-10-20 19:30:34 浏览: 101
Vue学习之旅Part16:Vue结合webpack使用vue-router实现路由和子路由
不,子路由不写<router-view>是不能显示的。在VueRouter中,<router-view>是用来显示匹配到的组件内容的地方。如果没有写<router-view>,则无法将子路由对应的组件内容渲染到页面上。所以,需要在配置子路由时,确保在模板中正确地写上<router-view>。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [总结|VueRouter子路由不显示,不报错的问题](https://blog.csdn.net/m0_46635519/article/details/123297388)[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: 33.333333333333336%"]
- *2* [vue2.0 路由不显示router-view的解决方法](https://download.csdn.net/download/weixin_38677244/12762796)[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: 33.333333333333336%"]
- *3* [解决vue更新路由router-view复用组件内容不刷新的问题](https://download.csdn.net/download/weixin_38748556/12932708)[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: 33.333333333333336%"]
[ .reference_list ]
阅读全文