美文网首页
vue2.0 基于elementUI中的el-select,实现

vue2.0 基于elementUI中的el-select,实现

作者: wxw_威 | 来源:发表于2024-02-25 17:02 被阅读0次

处理大量数据,用ElSelectV2实现虚拟列表展示。

因为是基于Elementui 中的el-select,所以要引入Elementui
用法:
1、安装:

npm i el-select-v2

2、main.js 中引入

  import Vue from 'vue';
  // 必须引入 element-ui
  import ElementUI from 'element-ui';
  import 'element-ui/lib/theme-chalk/index.css';
  import ElSelectV2 from 'el-select-v2';

  Vue.use(ElSelectV2);

3、使用

<ElSelectV2
  v-model="value"
  :option:'options'
  clearable
  filterable
/>


options: 对象数组,结构一定是{label: xxx, value: xxx}

相关文章

网友评论

      本文标题:vue2.0 基于elementUI中的el-select,实现

      本文链接:https://www.haomeiwen.com/subject/dcuaadtx.html