首页 > 编程知识 正文

vue中如何使用select2(vue搜索功能如何实现)

时间:2023-05-04 01:01:19 阅读:67284 作者:4168

封装的附加链接的说明

数据传输

goodsTypeList:[],goodsTypeListCopy :[],methods

如果focus:(val )={ //搜索中没有数据,则必须重新赋值if (! this.product code list.length (this.product code list=this.product codelistcopy; //未选择,copy中有一个值,表示已搜索,下次打开时只显示需要重新赋值以前搜索的初始数据if (this.addobject.logisticsproductidthis.producthis ) { this.product code list=this.product codelistcoopy } { this.product code listcode },productfilter(val ) if (! this.goodstypelistcopy.length (/先复制再基于此搜索this.goodstypelistcopy=this.goods typelistcopy; (if (! val )//如果没有向搜索框传递值,则this.goods typelist=this.goodstypelistcopy; 返回; } this.goodsTypeList=[]; this.goodstypelistcopy.length this.goodstypelistcopy.foreach () item ) (item .需要匹配的属性。 索引关闭) val )!=-1 ) this.Goodstypelist.push(item ); //推送匹配的数据}; )、组件

El-select style=' width :150 px ' @ focus=' focus ' filterable 3360 filter-method=' product filter ' @ change=' proood .请选择shiplineid ' placeholder=' El-optionv-for=' iteminprododer=' item.code ' : value=' item.id '

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。