站長資訊網
        最全最豐富的資訊網站

        bootstrap和vue能一起用嗎

        bootstrap和vue能一起用,vue寫模板用bootstrap可提高開發效率;且vue專門提供了一個ui組件庫BootstrapVue,用于使用Vue.js+Bootstrap4在web上構建響應迅速,移動優先的網站。

        bootstrap和vue能一起用嗎

        本教程操作環境:Windows7系統、vue2.9.6&&bootsrap4版、DELL G3電腦

        bootstrap和vue能一起用,兩者是兼容的,不會沖突,vue寫模板用bootstrap可提高開發效率。

        Vue中使用Bootstrap的方法

        1、安裝bootstrap庫:

        在項目的根目錄下,輸入命令:

        npm install bootstrap3 -S

        在這里我選擇bootstrap3版本的

        2、然后在main.js文件中引入bootstrap

        bootstrap和vue能一起用嗎

        3、在template中寫Bootstrap提供的html組件結構即可

        另外還可使用BootstrapVue框架

        vue有專門一個ui組件庫BootstrapVue,它基于世界上最流行的框架Bootstrap v4,用于使用Vue.js在web上構建響應迅速,移動優先的站點。

        BootstrapVue 是基于 Bootstrap v4 + Vue.js 的前端 UI 框架。BootstrapVue 作為學習 Vue.js 框架本身的入門框架,我認為是非常不錯的。Bootstrap 框架本身是輕量級的、易于學習的,在世界范圍內非常流行,有許多第三方插件和主題樣式。Vue.js 作為一個漸進式框架,核心庫只關注視圖層,不僅易于上手,還便于與第三方框架或既有項目整合。

        1、安裝 BootstrapVue

        npm install bootstra-vue bootstrap axios

        引入 BootstrapVue 和 Bootstrap CSS

        2、修改 src/main.js

        import Vue from 'vue' import App from './App.vue' import BootstrapVue from 'bootstrap-vue' import 'bootstrap/dist/css/bootstrap.css' import 'bootstrap-vue/dist/bootstrap-vue.css'   Vue.use(BootstrapVue) Vue.config.productionTip = true   new Vue({   render: h => h(App), }).$mount('#app')

        3、修改 src/components/HelloWorld.vue:

        <template>   <b-container fluid class="p-4">     <b-row>       <b-col sm="3" v-for="item in list" v-bind:key="item.index">         <b-img thumbnail fluid :src="item.strCategoryThumb" v-bind="mainProps"></b-img>       </b-col>     </b-row>   </b-container> </template>   <script> import axios from "axios"   export default {   name: 'HelloWorld',   data() {     return {       mainProps: {         class: 'mb-2'       },       list: []     }   },   mounted() {     axios         .get("https://www.themealdb.com/api/json/v1/1/categories.php")         .then(response => {         this.list = response.data.categories       })         .catch(err => {         console.log(err)       })   } } </script>

        推薦學習:《bootstrap使用教程》

        贊(0)
        分享到: 更多 (0)
        網站地圖   滬ICP備18035694號-2    滬公網安備31011702889846號
        主站蜘蛛池模板: 无码欧精品亚洲日韩一区| 久久久久99精品成人片直播| 亚洲精品高清一二区久久| 精品久久一区二区| 亚洲精品无码成人AAA片| 国产亚洲精品高清在线| 成人国产精品999视频| 亚洲精品成人片在线观看| AAA级久久久精品无码区| 成人午夜精品网站在线观看 | 精品国产综合区久久久久久| 99国产精品久久久久久久成人热| 亚洲国产精品无码久久98| 四库影院永久四虎精品国产| 国产亚洲精品精品国产亚洲综合| 亚洲国产精品久久久久婷婷老年 | 一区二区日韩国产精品| 久久精品国产色蜜蜜麻豆| 99久久婷婷国产综合精品草原| 动漫精品专区一区二区三区不卡| 久久精品国产第一区二区三区| 亚洲精品专区| 亚洲AV日韩精品一区二区三区| 精品一区二区无码AV| 国产欧美一区二区精品性色99 | 精品欧美一区二区在线看片 | 国产精品久久毛片完整版| 精品国际久久久久999波多野| 无码囯产精品一区二区免费 | 最新欧美性爱精品一区二区三区| 久久亚洲中文字幕精品一区| 国产在线精品一区二区高清不卡| 国产精品成人免费观看| 国产精品免费久久| 2021年精品国产福利在线| 日韩欧美精品不卡| 欧美精品国产一区二区| 91精品国产综合久久香蕉 | 中文字幕精品一区二区三区视频| 亚洲国产成人久久精品99| 亚洲国产成人久久精品99 |