【发布时间】:2018-11-08 16:56:24
【问题描述】:
我有一个拆分布局,就像您在以下示例屏幕中看到的那样。默认情况下,固定的应用程序 vue 内容占界面左侧的 40%,路由器视图占右侧的 60%。
现在的问题是:其中一个组件,在此示例中,路由器链接 3 应该是全屏的。我不知道路由器组件如何与应用程序 vue 重叠。它总是在它下面。
这是我当前的代码
app.vue:
<template>
<div class="left">
<router-link to="/link1">
<router-link to="/link2">
<router-link to="/link3">
</div>
// some content
<router-view></router-view>
</template>
<style>
.left {
width: 40%;
position: fixed;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
</style>
组件 1 和 2:
<template>
<div class="container">
// same content
</div>
</template>
<style>
.container {
display: inline-block;
margin-left: 40%;
width: 60%;
height: 100vh;
}
</style>
组件 3:
<template>
<div class="container">
// same content
</div>
</template>
<style>
.container {
display: inline-block;
width: 100%;
height: 100vh;
}
</style>
【问题讨论】: