[Vuejs]-How to use bootstrap 4 in vue.js 2 without bootstrap-vue?

0๐Ÿ‘

โœ…

You can use vanilla bootstrap in a vue project. Just install bootstrap by running

npm i bootstrap popper.js jquery

Popper.js and jquery are dependencies of bootstrap.
In your main.js file, you import bootstrap by adding:

import "bootstrap";
import "bootstrap/dist/css/bootstrap.min.css"

0๐Ÿ‘

Per official Bootstrap doc, the following components require JQuery, bootstrap.js and Popper.js:

Alerts for dismissing

Buttons for toggling states and checkbox/radio functionality

Carousel for all slide behaviors, controls, and indicators

Collapse for toggling visibility of content

Dropdowns for displaying and positioning (also requires Popper)

Modals for displaying, positioning, and scroll behavior

Navbar for extending our Collapse plugin to implement responsive behavior

Tooltips and popovers for displaying and positioning (also requires Popper)

Scrollspy for scroll behavior and navigation updates

Leave a comment