HUNcut_
HUNcut_

Reputation: 47

How to use bootstrap in vue

I am trying to use Bootstrap in my Vue project. (created with the Vue cli)
I have installed the following things through npm.

I have imported Bootsrap into my main.js

import 'bootstrap'
import 'bootstrap/dist/css/bootstrap.min.css'

The problem is that I can't use the dropdowns in Bootsrap.
Is there anything else I should do?

Upvotes: 1

Views: 1538

Answers (1)

Amaarockz
Amaarockz

Reputation: 4684

there is bootstrap package specially for vue you can use the following commands to install it

npm install bootstrap-vue

OR

yarn add bootstrap-vue

and then in your main.js file you can import it and use it as

import BootstrapVue from 'bootstrap-vue';
import 'bootstrap-vue/dist/bootstrap-vue.css';

Vue.use(BootstrapVue)

Upvotes: 2

Related Questions