1、在主组件展示二级路由的组件内容,在App.vue中添加
<br> <div class="container"> <!-- row 行排列 --> <div class="row"> <!-- 小屏展示12列,中屏展示4列 --> <div class="col-sm-12 col-md-4"> <router-view name="orderingGuide"></router-view> </div> <div class="col-sm-12 col-md-4"> <router-view name="delivery"></router-view> </div> <div class="col-sm-12 col-md-4"> <router-view name="history"></router-view> </div> </div> </div>
2、在index.js中修改路由配置
{path: ‘/‘, name: ‘homeLink‘, components:{ default:Home, ‘orderingGuide‘:OderingGuide, ‘delivery‘:Delivery, ‘history‘:History }},
原文地址:https://www.cnblogs.com/JimShi/p/11195035.html
时间: 2024-10-20 20:44:07