0

I started a project with vue/vuex and trying to add Bootstrap-vue to it.

How to organize main.js file merging two fragments -

import { createApp } from 'vue'
import App from './App.vue'
import store from './store'

const app = createApp(App)

app.use(store)

app.mount('#app')

---------------add this:

import Vue from 'vue'
import { BootstrapVue, IconsPlugin } from 'bootstrap-vue'

// Import Bootstrap and 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)

vuex starting code with bootstrap starting code ?

1 Answer 1

0

The upper part is Vue 3, the lower part is Vue 2 - the two do not mix, you have to use the one matching your Vue version.

Note that BootstrapVue does not yet support Vue 3, so you either have to downgrade to Vue 2, use the compat module, wait a while or switch to a different design system, like Vuetify, PrimeVue, Antd, etc.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.