向各位大佬请教:
我在vuejs项目中使用element-ui进行页面布局,el-container作为容器,子元素为el-header,el-main,el-main只有一张logo图片,el-header只有一个登录框,那么el-container怎么实现满屏布局呢?
望各位大佬不吝赐教!小白我十分感谢!
建议参考博客 el-container 实践上的布局问题(网址https://www.cnblogs.com/ertingbo/p/8135391.html),以及博客Container 布局容https://www.cnblogs.com/grt322/p/8531882.html
https://www.cnblogs.com/ertingbo/p/8135391.html
参考https://www.cnblogs.com/lccluyan/p/8351787.html
不知道你们能不能用到
代码样例
<template>
<el-container>
<el-header>Header 默认 height: 60px;</el-header>
<el-container :style="height">
<el-aside width="200px">Aside</el-aside>
<el-main>
<el-col>
<span>Main</span>
</el-col>
<el-col>
<span>height:window.innerHeight - 120</span>
</el-col>
<el-col>
<span>(右侧通常会有上下滚动栏,120 + 16左右就会消失)</span>
</el-col>
</el-main>
</el-container>
<el-footer>Footer 默认 height: 60px;</el-footer>
</el-container>
</template>
<style>
.el-header, .el-footer {
background-color: #B3C0D1;
color: #333;
text-align: center;
line-height: 60px;
}
.el-aside {
background-color: #D3DCE6;
color: #333;
text-align: center;
line-height: 200px;
}
.el-main {
background-color: #E9EEF3;
color: #333;
text-align: center;
line-height: 160px;
}
</style>
<script>
export default {
data () {
return {
height: {
height: window.innerHeight - 136 + 'px'
}
}
}
}
</script>