select2搜索内容显示搜索词

来源:互联网 发布:淘宝直通车怎么选词 编辑:程序博客网 时间:2024/04/28 14:49

         在使用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标签,这样在搜索结果中就不会出现搜索关键词。


    

1 0
原创粉丝点击