赞
踩
代码如下:
- <el-form-item label="巡检人员" :label-width="formLabelWidth">
- <el-select
- v-model="addForm.inspectionPerson"
- placeholder="请选择巡检人员"
- ref="choose"
- multiple
- @focus="showSelectPersonDialog()"
- >
- </el-select>
- </el-form-item>
- <el-dialog :visible.sync="selectPersonDialogVisible" modal="false">
- <el-table
- :data="inspectionPersonList"
- @selection-change="handleSelectPersonList"
- >
- <el-table-column type="selection"></el-table-column>
- <el-table-column prop="name" label="姓名"></el-table-column>
- <el-table-column prop="age" label="年龄"></el-table-column>
- <el-table-column prop="gender" label="性别"></el-table-column>
- </el-table>
- <div slot="footer" class="dialog-footer">
- <el-button @click="selectPersonDialogVisible = false"
- >取 消</el-button
- >
- <el-button type="primary" @click="confirmSelectPerson"
- >确 定</el-button
- >
- </div>
- </el-dialog>
- showSelectPersonDialog() {
- this.$refs.choose.blur();
- this.selectPersonDialogVisible = true;
- },
为el-select绑定ref="choose",在对应的方法里写入:this.$refs.choose.blur();这样下拉框就可以隐藏啦。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。