본문 바로가기
Programming/Javascript

Vue3 + bootstrap5 적용하기

by Wilkyway 2022. 5. 28.

1. 설치

npm i --save bootstrap
npm i --save @popperjs/core  // 부트스트랩 실행에 필요

2. main.js에 두줄만 Import하면 됨

import { createApp } from 'vue'
import App from './App.vue'
import router from './router/index.js'

// 아래 두줄만 넣으면 된다.
import 'bootstrap/dist/css/bootstrap.min.css'
import 'bootstrap'

createApp(App)
.use(router)
.mount('#app')

 

*** bootstrap-vue 적용하기

npm install vue bootstrap-vue bootstrap

 

이제 main.js에  import

import BootstrapVue from 'bootstrap-vue'
import 'bootstrap/dist/css/bootstrap.min.css'
import 'bootstrap-vue/dist/bootstrap-vue.css'

Vue.use(BootstrapVue)
반응형

댓글0