wenzhixin / multiple-select

A jQuery plugin to select multiple elements with checkboxes :)
http://multiple-select.wenzhixin.net.cn
MIT License
1.91k stars 651 forks source link

ES6 Import Syntax #478

Closed vielhuber closed 5 years ago

vielhuber commented 5 years ago

Hello!

How can I import multiple-select in my ES6 classes?

I've tried

npm install multiple-select

and

import 'multiple-select/dist/multiple-select.js';
/* ... */
$('.foo').multipleSelect();

but this does not work.

wenzhixin commented 5 years ago

http://multiple-select.wenzhixin.net.cn/docs/en/webpack#starter-template

You need to import jquery:

import './jquery.js'
vielhuber commented 5 years ago

Cool, this worked:

import jQuery from 'jquery';
window.$ = window.jQuery = jQuery;
import 'multiple-select/dist/multiple-select.js';