router设置:
{
path: '/search',
component: () => import('../views/SearchView.vue'),
children: [{ path: 'searchone', component: () => import('../components/searchTable/SearchOne.vue') }]
}
路由占位符:
<template>
<div>
<div class="menu">
<MySidebar :isCollapse="isCollapse" style="position: relative;"></MySidebar>
</div>
<div class="content" :class="{ active: isCollapse }">
<MyHeader @changeMenu="changeMenu" :isCollapse="!isCollapse"></MyHeader>
<div class="main">
<router-view></router-view>
</div>
</div>
</div>
</template>
父组件css
.content {
padding-left: 200px;
transition: all 0.6s;
.main {
width: 100%;
height: 100%;
}
}
子组件內联css:<div style="height:100px;width:100px">
控制台查看元素,子组件压根没渲染到父组件中,,哪里设置出问题了吗?
SearchView.vue 里面有路由出口嘛?