mirror of
https://github.com/Choices-js/Choices.git
synced 2024-04-27 19:42:51 +02:00
Fix for the webpack issue
export choices as a class to circumvent the webpack issue
This commit is contained in:
parent
2fa92520ef
commit
f9f63e7aba
|
@ -43,7 +43,7 @@ import {
|
||||||
* Choices
|
* Choices
|
||||||
* @author Josh Johnson<josh@joshuajohnson.co.uk>
|
* @author Josh Johnson<josh@joshuajohnson.co.uk>
|
||||||
*/
|
*/
|
||||||
class Choices {
|
export class Choices {
|
||||||
constructor(element = '[data-choice]', userConfig = {}) {
|
constructor(element = '[data-choice]', userConfig = {}) {
|
||||||
if (isType('String', element)) {
|
if (isType('String', element)) {
|
||||||
const elements = Array.from(document.querySelectorAll(element));
|
const elements = Array.from(document.querySelectorAll(element));
|
||||||
|
@ -2083,5 +2083,3 @@ class Choices {
|
||||||
}
|
}
|
||||||
|
|
||||||
Choices.userDefaults = {};
|
Choices.userDefaults = {};
|
||||||
// We cannot export default here due to Webpack: https://github.com/webpack/webpack/issues/3929
|
|
||||||
module.exports = Choices;
|
|
||||||
|
|
Loading…
Reference in a new issue