1. 路由模板之--同时加载多个动态模块
router.js:
export default new Router({
routes: [
{
path: '/',
components:{
a: Home,
b: Guide
}
}
]
})
App.vue :
<template>
<div id="app">
<router-view name="a"></router-view>
<router-view name="b"></router-view>
</div>
</template>
总结:当一个页面需要加载多个动态组件时,通过 router-view 的name属性对应路由的配置就OK了!!!