1 回答
TA贡献1875条经验 获得超5个赞
可以参考楼上的命名视图做,
我给你发一段router的配置,你一看就懂
routes: [
{
path: '/login',
name: 'login',
meta: {auth: false, title: '登录'},
component: Login
},
{
path: '/',
meta: {title: '首页', active: 1},
component: resolve => require(['../pages/main'], resolve),
children: [
erp,
crm,
...
}]
main.vue
<template>
<el-row class="container">
<el-col :span="24" class="header">
<router-view name="top"></router-view>
</el-col>
<el-col :span="24" class="main">
<aside>
<router-view name="left"></router-view>
</aside>
<section class="content-container">
<transition name="fade">
<router-view keep-alive></router-view>
</transition>
</section>
</el-col>
</el-row>
</template>
添加回答
举报