BootstrapVueãã¤ã³ã¹ãã¼ã«
vue create my-bootstrapã§ç°å¢æ§ç¯å¾ãnpm i bootstrap-vueã§BootstrapVueãã¤ã³ã¹ãã¼ã«ããã
ãã¨ã¯main.jsã«CSSãèªã¿è¾¼ãããã®è¨è¿°ã2è¡è¿½å ããã ãã§Bootstrapã使ç¨ã§ããããã«ãªãã
import Vue from 'vue' import App from './App.vue' import 'bootstrap/dist/css/bootstrap.css' import 'bootstrap-vue/dist/bootstrap-vue.css' Vue.config.productionTip = false new Vue({ render: h => h(App), }).$mount('#app')
App.vueã«Bootstrapã®classãä»ããHTMLãyarn serveãå®è¡ãã¦è¦ãã°Bootstrapã®CSSãé©ç¨ããã¦ããã®ã確èªã§ããã
<button type="button" class="btn btn-secondary">Button</button>
BootstrapVueã使ç¨ããæ¹æ³
BootstrapVueã¨ã¯<b-button>ã®ãããªBootstrapVueã®å°ç¨ã¿ã°ãåãè¾¼ãã ãã§ãåè¿°ã®ãã¿ã³ãªã©ãç°¡åã«ä½æããããã®ãã®ã ã
使ç¨ããã«ã¯bootstrap-vueãimportãã¦Vue.use(BootstrapVue)ãæå®ããã
import Vue from 'vue' import App from './App.vue' import 'bootstrap/dist/css/bootstrap.css' import 'bootstrap-vue/dist/bootstrap-vue.css' import BootstrapVue from 'bootstrap-vue' Vue.use(BootstrapVue)
ä¾ãã°ä¸è¨ã®2ã¤ã¯åãçµæã®ã³ã¼ãã«ãªãã
<button type="button" class="btn btn-secondary">Button</button> <hr> <b-button>Button</b-button>
BootstrapVue b-buttonãµã³ãã«
BootstrapVueã®ç¬èªã¿ã°ã¯BootstrapVueã®Componentsã®ãã¼ã¸ã«è¨è¼ããã¦ããããããã¹ã¦è¦ãã¦ããã¨è¯ãã ããã
https://bootstrap-vue.js.org/docs/components/alert
æ®éã«Bootstrapã ãã使ç¨ããã®ã¨æ¯ã¹ã¦ã³ã¼ãéãå¤§å¹ ã«æ¸ãããã¨ãã§ããã