代码示例:
<el-form :model="form" :rules="rules" label-width="80px" inline> <el-row> <el-col :span="6"> <el-form-item label="First" word prop="first"> <el-input v-model="form.first" placeholder="First"></el-input> </el-form-item> </el-col> <el-col :span="6"> <el-form-item label="Second" word prop="second"> <el-input v-model="form.second" placeholder="Second"></el-input> </el-form-item> </el-col> <el-col :span="6"> <el-form-item label="Third" word prop="third"> <el-input v-model="form.third" placeholder="Third"></el-input> </el-form-item> </el-col> <el-col :span="3"> <el-button type="primary">First button</el-button> </el-col> <el-col :span="3"> <el-button type="success">Second button</el-button> </el-col> </el-row> </el-form>
核心是使用element ui的<el-row>配合<el-col>进行布局;
使用<el-form>配合<el-form-item>可以给每个输入框前显示文本。
当然也可以直接将文本放在单独的<el-col>标签内。如果和<input>标签放在一个<el-col>标签内,会变形,需要自己调整样式。
标签:标签,button,element,输入框,ui,按钮 From: https://www.cnblogs.com/Tpf386/p/17696130.html