• 让Element-ui的Container布局容器高度百分百显示


    使用Element(2.13.1版本)的Container布局容器布局,按照官网的代码运行后不能撑开整个页面,只能显示一段高度,代码如下:

        <el-container>
          <el-header>Header</el-header>
          <el-container>
            <el-aside width="210px">
                left
            </el-aside>
            <el-main>Main</el-main>
          </el-container>
        </el-container>

    那如何让它高度百分百显示呢?

    给html、body、#app及最外层.el-container的height设置100%即可。

    index.html:

    <!DOCTYPE html>
    <html>
    
    <head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width,initial-scale=1.0">
      <title>demo1</title>
      <style>
        html,
        body {
          margin: 0;
          height: 100%;
        }
      </style>
    </head>
    
    <body>
      <div id="app"></div>
      <!-- built files will be auto injected -->
    </body>
    
    </html>

    app.vue: 

    <template>
      <div id="app">
        <el-container style="height: 100%;">
          <el-header>Header</el-header>
          <el-container>
            <el-aside width="210px">
                left
            </el-aside>
            <el-main>Main</el-main>
          </el-container>
        </el-container>
      </div>
    </template>
    
    <script>
    export default {
      name: "App",
      components: {
        
      }
    };
    </script>
    
    <style>
    #app {
      font-family: "Avenir", Helvetica, Arial, sans-serif;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      color: #2c3e50;
      height: 100%;
    }
    
    .el-header,
    .el-footer {
      background-color: #b3c0d1;
      color: #333;
      line-height: 80px;
    }
    
    .el-aside {
      background-color: #d3dce6;
      color: #333;
    }
    
    .el-main {
      background-color: #e9eef3;
      color: #333;
      line-height: 160px;
    }
    
    body > .el-container {
      margin-bottom: 40px;
    }
    
    .el-container:nth-child(5) .el-aside,
    .el-container:nth-child(6) .el-aside {
      line-height: 260px;
    }
    
    .el-container:nth-child(7) .el-aside {
      line-height: 320px;
    }
    </style>
    
  • 相关阅读:
    springmvc配置全局日期转换器
    JSON反序列化没有真正数组,本质类型都是List<Object>
    优化.Net MVC 访问页面慢
    Log4j2过滤日志级别配置
    Springboot重新加载Bean
    CTFWeb:Oracle SQL 注入
    CTFWeb:SqlServer SQL 注入
    操作系统:文件系统
    操作系统:多级反馈队列和比例份额
    Android:利用系统服务设置系统音量
  • 原文地址:https://www.cnblogs.com/samve/p/12732140.html
Copyright © 2020-2023  润新知