vue el-form设置横向3连
时间: 2024-01-12 16:02:39 浏览: 297
在Vue的el-form中,想要实现横向3连的效果可以使用element-ui提供的Layout布局来实现。可以将三个el-form-item放置在el-row中,然后使用col属性设置宽度比例,从而实现横向排列。具体代码如下所示:
```
<el-form>
<el-row>
<el-col :span="8">
<el-form-item>
<!-- 第一个表单项的内容 -->
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item>
<!-- 第二个表单项的内容 -->
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item>
<!-- 第三个表单项的内容 -->
</el-form-item>
</el-col>
</el-row>
</el-form>
```
通过上述代码,可以将三个el-form-item横向排列,并且可以根据需要调整每个表单项所占的宽度比例。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [element的form表单中如何一行显示多el-form-item标签](https://blog.csdn.net/migexiaoliang/article/details/126336394)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *3* [VUE2.0 ElementUI2.0表格el-table自适应高度的实现方法](https://download.csdn.net/download/weixin_38593701/13982200)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文