Adding bootstrap to Vue CLI project

后端 未结 7 1158
轻奢々
轻奢々 2021-01-31 09:58

I\'m new to Vue and webpack in general and I\'m having a hard time figuring out how to import things.

I created a fresh Vue project through vue init I added

7条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-31 10:14

    jQuery is not required in current version (Right now: "bootstrap": "^4.4.1", "bootstrap-vue": "^2.5.0")

    • install bootstrap
      • npm install bootstrap-vue bootstrap --save
    • Then, register BootstrapVue in your app entry point (main.js)
      • import BootstrapVue from 'bootstrap-vue/dist/bootstrap-vue.esm';
      • Vue.use(BootstrapVue)
    • And import Bootstrap and BootstrapVue css files in main.js:
      • import 'bootstrap/dist/css/bootstrap.css'
      • import 'bootstrap-vue/dist/bootstrap-vue.css'

提交回复
热议问题