Use of BootStrapVue

1. Create a Vue project

vue create vue-blog

Insert picture description here

2. Run the Vue project

npm run serve

The following interface appears
Insert picture description here

3. Install BootstrapVue dependencies

cnpm install bootstrap-vue bootstrap

Insert picture description here

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>

Insert picture description here
Found that the Bootstrap style has taken effect

See BootstrapVue official website for details

Guess you like

Origin blog.csdn.net/rj2017211811/article/details/109649333
use
use