VUE ELEMENT UI 清空select 下拉选项

1.select代码

<el-form ref="searchForm" :inline="true" :model="searchForm" label-width="80px"><el-form-item label="设备类别" prop="equipmentType"><el-select v-model="searchForm.equipmentType.code" clearable @change="getEquipment($event)"><el-option v-for="(item, index) in equipmentTypeList" :key="index" :label="item.desc" :value="item.code"></el-option></el-select></el-form-item><el-form-item label="细分类别" prop="equipmentDescType"><el-select v-model="searchForm.equipmentDescType.code" clearable><el-option v-for="(item, index) in equipmentDescTypeList" :key="index" :label="item.desc" :value="item.code"></el-option></el-select></el-form-item>
</el-form>

2.JS代码

vm.searchForm.equipmentDescType.code = ‘’;

async getEquipment(event){const vm = this;vm.dictSearch.dictCodes = [];// 清空下拉框vm.searchForm.equipmentDescType.code = '';vm.dictSearch.dictCodes.push(event);const res = await comApiList.dictionaryItemList(vm.dictSearch);if (res.data.code === 0) {const data = res.data.data;if (data) {vm.equipmentDescTypeList = data[event];}} else {vm.$message({message: res.data.msg,type: "error"});}
}

3.最后测试一下

VUE ELEMENT UI 清空select 下拉选项相关推荐

  1. element ui中select 下拉框在火狐浏览器最后一行显示不完全(谷歌正常)

    在项目开发的时候用到了el-scrollbar组件 并且设置了隐藏横向滚动条 下面展示一些 内联代码片. // 隐藏横向滚动条 .el-scrollbar__wrap {overflow-x: hid ...

  2. 修改element UI的select下拉框组件右边的小箭头(使用自定义图片)

    i.el-select__caret {/*很关键:将默认的select选择框样式清除*/ appearance:none;-moz-appearance:none;-webkit-appearanc ...

  3. element ui中select 下拉选择文字输入筛选

    未修改代码前效果 选择框中不可编辑 如图:加入 filterable allow-create default-first-option 代码如下 <template><div> ...

  4. element UI select下拉选项位置问题

    element UI select下拉选项位置问题 在使用elementUI下拉选项时,可能存在下拉时下拉列表选项框的位置距离下拉框所在的位置距离过大,这个是由于elementUI自己设置的根据下拉框 ...

  5. 微信小程序下拉框插件_微信小程序自定义select下拉选项框组件的实现代码_清玖_前端开发者...

    知识点:组件,animation,获取当前点击元素的索引与内容 微信小程序中没有select下拉选项框,所以只有自定义.自定义的话,可以选择模板的方式,也可以选择组件的方式来创建. 这次我选择了组件, ...

  6. java select 下拉选项框option定位_java select 下拉选项框opt

    java select 下拉选项框opt [2021-02-05 09:44:01]  简介: php去除nbsp的方法:首先创建一个PHP代码示例文件:然后通过"preg_replace( ...

  7. select下拉选项的selectedIndex属性(你用过吗)

    目录 内容介绍 一.使用方法 1.设置选中项 2.获取索引 3.删除指定项 4.修改指定项文本 二.示例: 内容介绍   selectIndex为被选中option元素的索引值,通过selectInd ...

  8. 学习使用jquery控制select下拉选项的字体样式

    学习使用jquery控制select下拉选项的字体样式 实现代码 实现代码 <script src="../jquery-2.1.4.min.js"></scri ...

  9. vue 的elementui中select下拉框多选项-multiple属性

    vue的select下拉框多选项-multiple属性 最近在使用vue-element-admin这个后台管理框架开源模板在做一个管理后台,使用起来其实还挺方便的,大部分的组件源码里面都已经写好了, ...

最新文章

  1. 2022-2028年中国塑料人造革行业市场研究及前瞻分析报告
  2. 查找命令find的用法
  3. 404 – File or directory not found.
  4. 扫描PDF417崩溃的原因找到:手机摄像头分辨率低
  5. OpenCV学习笔记(十):图像金字塔Pyramid和图像缩放:pyrDown(),pyrUp(),resize()
  6. php heredoc 用法
  7. curl post json_curl 模拟 GETPOST 请求,以及 curl post 上传文件
  8. 关于微信隐藏分享按钮的心得
  9. 六石风格:雨伞用袋子套起来
  10. JSP分页显示(前端处理)
  11. 15 个提高 Google 搜索效率的小技巧
  12. ANOVA,T检验,秩和检验
  13. win7设置无线wifi连接到服务器,自动连接wifi怎么设置_如何设置无线网自动连接...
  14. Android原生插件开发-开发篇
  15. H5公众号-canvas海报分享图+生成二维码
  16. oracle runInstaller报错SEVERE: Remote ‘AttachHome‘ on node ‘rac102‘ failed
  17. 纯原生JS实现导出Excel文件
  18. java线程中断 interrupt
  19. 多边形分解成三角形算法, 耳切法
  20. Workflow Engine for .Net Core ENTERPRISE v4.0.10-SEO-狼术

热门文章

  1. datastage 如何把db2的varchar列数据抽取到mysql的longtext列
  2. 详解Axes()中的markersize
  3. mybatis运行报错java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed
  4. InputStream读取数据
  5. 完全二叉树与满二叉树的区别(有图)
  6. Linux下干净卸载mysql详解
  7. Shell grep命令
  8. c++后端开发面试题
  9. php函数库快速记忆法_史上最全的php函数大全
  10. OpenCV混合高斯模型前景分离