[Vuejs]-Include bootstrap features into a custom vuejs component

0👍

I figured it out, require works while import does not.

 // Declare $ and jQuery globally into my whole app :(
 window.$ = window.jQuery = jQuery;
 // this does not work
 // import collapse from 'path/to/bootstrap/feature/collapse.js";
 require('path/to/bootstrap/feature/collapse.js');

0👍

  1. Verify that jQuery isn’t already loaded. Loading it twice might cause some issues. Remove your jquery import and maybe check in console.log($) if they’ve built it on jQuery chances are it’s already there.
  2. If 1. fails you have to import jQuery in you main js file or to import it globally.

Leave a comment