Element el-table 在flex布局的宽度自适应问题
bug::在flex容器下面的一个flex:1的子容器里面写了个el-table用来展示列表数据,el-table的宽度不会跟随flex容器进行自适应宽度。
原因:el-table的父元素不能是flex:1的元素,所以需要在flex属性的容器内设置position:relative,需要在el-table外面再加一层元素,并且父元素设置成absolute
.diagnosticlogout_box {
flex: 1;
position: relative;
}
.diagnosticlogout_table {
position: absolute;
width: 100%;
}