1. Create a Vue project
vue create vue-blog
2. Run the Vue project
npm run serve
The following interface appears
3. Install BootstrapVue dependencies
cnpm install bootstrap-vue bootstrap
3. Introduce BootstrapVue and Bootstrap CSS
Introduce the following code in main.js
import BootstrapVue from 'bootstrap-vue'
import 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap-vue/dist/bootstrap-vue.css'
Vue.use(BootstrapVue)
4. Use Bootstrap4 components
Modify the code in HelloWorld.Vue
<template>
<div class="alert alert-primary" role="alert">
A simple primary alert—check it out!
</div>
</template>
Found that the Bootstrap style has taken effect
See BootstrapVue official website for details