效果图:
代码:
<el-form :inline="true" label-width="140px" label-position="right" :model="formInline"
:class="['form', isEdit ? 'contract-form-noedit' : '']">
<el-form-item class="form-item-full event">
<el-button type="primary" @click="btnEdit">编辑</el-button>
</el-form-item>
<el-form-item label-width="auto" label="Approved by">
<el-input v-model="formInline.user" placeholder="Approved by" />
</el-form-item>
<el-form-item label="Activity zone">
<el-select v-model="formInline.region" placeholder="Activity zone">
<el-option label="Zone one" value="shanghai" />
<el-option label="Zone two" value="beijing" />
</el-select>
</el-form-item>
</el-form>
因为代码重复所以这些只写了一份
文章来源:https://www.toymoban.com/news/detail-516057.html
.form {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.el-form--inline .el-form-item {
flex: 1 0 40%;
align-items: center;
}
//第一行按钮独占一行
.form-item-full {
flex: 100% !important;
}
css设置这些就ok了 文章来源地址https://www.toymoban.com/news/detail-516057.html
到了这里,关于element-ui的el-form表单一行两个显示效果的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!