F
F
fgjcirifb2019-02-25 15:44:41
JavaScript
fgjcirifb, 2019-02-25 15:44:41

Select2 language file not seeing jQuery?

I use Babel. I created a JS file, wrote the code, imported select2 and the language file from above:

import {$, jQuery} from 'jquery'
import 'select2'
import 'select2/dist/js/i18n/ru'


Then I set the desired language in the initialization:

$('#select').select2({
  language: 'ru'
})


Then I looked at the compiled file, the language file was successfully inserted. But the error is that he does not see jQuery. If you remove the language, then select2 itself sees jq perfectly. How to solve the problem?

from the github repository:

Select2 supports multiple languages ​​by simply including the right language JS file (dist/js/i18n/it.js, dist/js/i18n/nl.js, etc.) after dist/js/select2.js.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question