基于sass编写,在全局样式文件里写:
@for $num from 1 through 99{
.form-col-#{num}{
width: 100%;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
.el-form-item{
width: 100%/$num;
}
.el-form-item__content{
width:66%;
.el-select--medium{
width: 100%;
}
}
}
}
<el-form class="form-col-2"></el-form>