How to add class to select2 element in v4.0

后端 未结 5 1629
故里飘歌
故里飘歌 2021-02-12 04:04

This is very similar to this question on how to add class to select2 element, however the answers there appear to target earlier versions of the framework which has undergone so

5条回答
  •  佛祖请我去吃肉
    2021-02-12 04:57

    Here is the short answer if you want to add class to all elements.

    $.fn.select2.defaults.set('containerCssClass', 'wrap');
    

提交回复
热议问题