This content originally appeared on CodeSource.io and was authored by Deven
If you are getting uncaught typeerror: $(…).select2 is not a function error, this article will help you fix the issue.
Consider the example below:
mounted() {
$('select').select2();
},
we usually get this error when Jquery is loaded twice, To see if jQuery is loaded properly, type $ in the browser console to see if it returns the appropriate code. If it does, then it is your select2 module.
You may also try checking if Script loading is in correct order like below:
1. jQuery,
2. select2,
3. your js files
The post Fix – uncaught typeerror: $(…).select2 is not a function appeared first on CodeSource.io.
This content originally appeared on CodeSource.io and was authored by Deven
Deven | Sciencx (2021-02-26T16:06:03+00:00) Fix – uncaught typeerror: $(…).select2 is not a function. Retrieved from https://www.scien.cx/2021/02/26/fix-uncaught-typeerror-select2-is-not-a-function/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.