代码如下: <el-row type="flex" class="row-bg"> <el-col :span="12"> <el-form-item label="编号前缀:" :label-width="formLabelWidth" prop="prefix"> <el-input v-model="carForm.prefix" autocomplete="off" class="prefix-input" readonly style="width:70px"></el-input> </el-form-item> </el-col> <el-form-item :label-width="formLabelWidth" prop="num" style="margin-left:-100px"> <el-input v-model="carForm.num" autocomplete="off" class="num-input" style="width:60px"></el-input> <el-button type="primary" @click="getPrefix" size="small">自动获取</el-button> </el-form-item> </el-row> 效果如下: 注意:若表单中的项需要验证时,这里的prop要和v-model里面的后面的变量名相同 <el-form-item label="选择车场:" :label-width="formLabelWidth" prop="uid"> <el-select v-model="carForm.uid" placeholder="请选择车场" class="sel-yard" @change="getName"> <el-option v-for="item in yard_list" :key="item.uuid" :label="item.name" :value="item.uuid"> </el-option> </el-select> </el-form-item>
评论 (0 )
最新评论
暂无评论
赶紧努力消灭 0 回复