<el-form :model="myForm" ref="myForm"> <el-form-item label="机构名称:" prop="orgnName" > <el-input v-model="myForm.orgnName" auto-complete="off" readonly></el-input> </el-form-item> <el-form-item label="人员角色:" prop="roleId"> <el-select v-model="myForm.roleId" placeholder="请选择角色" > <el-option v-for="item in roleDroplist" :key="item.id" :label="item.roleName" :value="item.id"></el-option> </el-select> </el-form-item> <el-form-item label="出生日期:" prop="birthday"> <el-date-picker v-model="myForm.birthday" type="date" value-format="yyyy-MM-dd" placeholder="请选择出生日期"> </el-date-picker> </el-form-item> <titleInfo> <li>保存信息</li> </titleInfo> <div class="btn_bottom"> <button class="btn search" @click="save">保存</button> <button class="btn repeat" @click="quit">取消</button> <button class="btn repeat" @click="rest">重置</button> </div> </el-form>
在每个el-form-item 标签上加上prop=“xxx” 对应的el-input 标签
//重置 rest() { this.$refs.myForm.resetFields(); // this.$refs[myForm].resetFields() },