Adding bootstrap to Vue CLI project

后端 未结 7 1290
轻奢々
轻奢々 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

    You don't want to do any kind of adjustment in webpack.config.js like adding jQuery global in plugin array. Once you installed all bootstrap dependencies like jQuery and popper than just import them in app.vue or main.js (you can import separately in each component if you wish)

    import 'bootstrap/dist/css/bootstrap.min.css'
    import 'jquery/src/jquery.js'
    import 'bootstrap/dist/js/bootstrap.min.js'
    

    thats it ..

提交回复
热议问题