How can I using select2 with webpack?

前端 未结 5 1280
醉酒成梦
醉酒成梦 2020-12-14 06:55

I\'m using webpack to manage all my assets, when I use this code to require select2 (https://github.com/select2/select2) I got the error

$(...).selec

5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-14 07:38

    You can simply do like this :

    import $ from 'jquery';
    import 'select2';
    
    
    $('selector').select2(); //selector can be className, ID, tag name , attributeName , etc ...
    

提交回复
热议问题