xxxxxxxxxx
npm install vue bootstrap bootstrap-vue
//then in main file
import { BootstrapVue, IconsPlugin } from 'bootstrap-vue'
// Import Bootstrap an BootstrapVue CSS files (order is important)
import 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap-vue/dist/bootstrap-vue.css'
// Make BootstrapVue available throughout your project
Vue.use(BootstrapVue)
// Optionally install the BootstrapVue icon components plugin
Vue.use(IconsPlugin)
xxxxxxxxxx
//run in your terminal
npm install bootstrap
// add in src/main.js
import { createApp } from "vue";
import App from "./App.vue";
//add this
import "bootstrap/dist/css/bootstrap.css";
createApp(App).mount("#app");
//add this
import "bootstrap/dist/js/bootstrap.js";
xxxxxxxxxx
-- command
npm install --save bootstrap
npm install --save @popperjs/core
-- in main.js
import "bootstrap/dist/css/bootstrap.min.css"
import "bootstrap
-- test
<button
class="btn btn-primary"
data-bs-target="#collapseTarget"
data-bs-toggle="collapse">
Bootstrap collapse
</button>
<div class="collapse py-2" id="collapseTarget">
This is the toggle-able content!
</div>
xxxxxxxxxx
//for vue 3(in theory)
cd [project-name]
vue add bootstrap-vue
//in vue 3, when running 'npm run serve' gives 4 warnings and the preview doesn't show up
//in vue 2 it works fine