在使用select2的搜索功能时,搜索结果会显示搜索关键词,这不是我想要的,我只想让用户选择列表框实际存在的数据,再一次还是select2 3.5版本(点击打开链接)的官方文档,官方解释:
Note that when tagging is enabled the user can select from pre-existing tags or create a new tag by picking the first choice which is what the user has typed into the search box so far
简单概述就是:如果使用了select2的tags标签,那么搜索结果就会显示搜索关键词
解决方案: 所以在初始化select2时不使用tags标签,这样在搜索结果中就不会出现搜索关键词。
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有