Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

SDCODE's avatar

Vue3- install BootstrapVue

How to install BootstrapVue in vue3?

0 likes
3 replies
CamKem's avatar
import Vue, { createApp } from '@vue/compat';
import BootstrapVue from 'bootstrap-vue';

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

Vue.use(BootstrapVue);
const app = createApp();
app.mount('#app');

It might help if you read through the docs in full - (https://bootstrap-vue.org/docs)

azbx's avatar

run these commands in order:

npm install vue bootstrap bootstrap-vue popperjs

Then in your app.js

import { createApp } from 'vue'
import BootstrapVue from 'bootstrap-vue';

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

Vue.use(BootstrapVue);
const app = createApp();
app.mount('#app');

If you are using inertia with Vite then use this app.js:

import { createApp, h } from 'vue'
import { createInertiaApp } from '@inertiajs/vue3'
import BootstrapVue from 'bootstrap-vue';
import 'bootstrap/dist/css/bootstrap.css';
import 'bootstrap-vue/dist/bootstrap-vue.css';

createInertiaApp({
  resolve: name => {
    const pages = import.meta.glob('./Pages/**/*.vue', { eager: true })
    return pages[`./Pages/${name}.vue`]
  },
  setup({ el, App, props, plugin }) {
    createApp({ render: () => h(App, props) })
      .use(plugin)
      .use(BootstrapVue)
	  .mount(el)
  },
})

If you are using inertia with Webpack then use this app.js:

import { createApp, h } from 'vue'
import { createInertiaApp } from '@inertiajs/vue3'
import BootstrapVue from 'bootstrap-vue';
import 'bootstrap/dist/css/bootstrap.css';
import 'bootstrap-vue/dist/bootstrap-vue.css';

createInertiaApp({
  resolve: name => require(`./Pages/${name}`),
  setup({ el, App, props, plugin }) {
    createApp({ render: () => h(App, props) })
      .use(plugin)
      .use(BootstrapVue)
	  .mount(el)
  },
})
1 like

Please or to participate in this conversation.