zoukankan      html  css  js  c++  java
  • vue Elemen-ui table 组件在使用flex布局后,表格宽度随页面变宽,但不能恢复的问题

    背景: 左侧伸缩导航菜单,右侧的剩余部分为表格,左侧导航隐藏后再显示,表格会出现滚动条

    <div class="flex">
        <aside style="100px">左侧导航</aside>
        <main class="flex1">
            <el-table>
            </el-table>
        </main>
    </div>
    <style>
        .flex{
            display: flex;
        }
        .flex1{
            flex:1;
        }
    </style>

    后修改为 定位

    <div>
        <aside></aside>
        <main>
            <el-table>
            </el-table>
        </main>
    </div>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        html,body{
            height: 100%;
             100%;
            box-sizing: border-box;
        }
        div {
            position: relative;
            height: 100%;
             100%;
        }
        aside {
            position: absolute;
             100px;
            top: 0;
            bottom: 0;
            left: 0;
            background-color: aquamarine;
        }
        main {
             100%;
            height: 100%;
            padding-left: 100px;
            box-sizing: border-box;
            background-color: aliceblue;
        }
    </style>

  • 相关阅读:
    tomcat7简单优化
    java向上转型和向下转型
    字符串循环移位
    测试覆盖率问题
    悬挂指针
    标准库string的用法探讨
    野指针问题
    Clock函数用法
    配置信息写入到.ini文件中的方法
    数组指针和数组引用做参数的区别
  • 原文地址:https://www.cnblogs.com/hill-foryou/p/14648827.html
Copyright © 2011-2022 走看看