I'm doing following:
npm install bootstrap-select
npm run dev
in app.scss
// Bootstrap Select
@import "node_modules/bootstrap-select/sass/bootstrap-select.scss";
In console it says:
jQuery.Deferred exception:
$(...).selectpickeris not a function
TypeError:$(...).selectpickeris not a function
I can see it installed bootstrap-select, how do I import it correctly?
In your /resources/assets/sass/app.scss import bootstrap-select:
@import "../../../node_modules/bootstrap-select/sass/bootstrap-select.scss";
You also need to import bootstrap-select.js to resources/assets/js/app.js make it work:
require('../../../node_modules/bootstrap-select/dist/js/bootstrap-select');
Its possible to add Bootstrap-Select without the complete path:
require('bootstrap-select');
require('bootstrap-select/js/i18n/defaults-de_DE');
@import '~bootstrap-select/sass/bootstrap-select.scss';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With