<router-view ></router-view> <router-view name="left" style="float:left;50%;background-color:#ccc;height:300px;"></router-view> <router-view name="right" style="float:right;50%;background-color:#c0c;height:300px;"></router-view>
从App.vue中的这三个<router-view >标签可见,需要我们配置三个区域,而配置工作是在index.js文件中的components字段进行的。在components里面定义好显示内容(这里是现实左边一个页面,右边一个页面)后,在App.vue里面添加router-link to我们就可以在在单页面点击后连接到不同的路由页面了。
单页面多路由操作就到这里啦。未完待续。