首頁  >  文章  >  web前端  >  vue能用bootstrap嗎

vue能用bootstrap嗎

angryTom
angryTom原創
2019-07-29 09:36:326369瀏覽

vue能用bootstrap嗎

如果你想了解更多關於bootstrap的知識,可以點選:bootstrap教學

一、引入jquery

#步驟:

1、安裝jquery

$ npm install jquery --save-dev

2、在webpack.config.js 加入內容

+ const webpack = require("webpack");
module.exports = {
    entry: './index.js',
    output: {
        path: path.join(__dirname, './dist'),
        publicPath: '/dist/',
        filename: 'index.js'
    },
  + plugins: [
        new webpack.ProvidePlugin({
            jQuery: 'jquery',
            $: 'jquery'
        })
    ]
}

##3、在入口檔index.js 裡面加內容

import $ from 'jquery' ;

4、測試是否安裝成功,看看能否彈出'123'# #

<template>
  <div>
   Hello world!
  </div>
</template>

<script>
$(function () {  
    alert(123);  
 }); 
export default {
};
</script>
<style>
</style>

二、引入Bootstrap

#1、安裝Bootstrap

$ npm install --save-dev bootstrap

# 2.在入口檔index.js裡引入相關

import &#39;./node_modules/bootstrap/dist/css/bootstrap.min.css&#39;;
import &#39;./node_modules/bootstrap/dist/js/bootstrap.min.js&#39;;

3、新增一段Bootstrap程式碼

<div class="btn-group" role="group" aria-label="...">  
      <button type="button" class="btn btn-default">Left</button>  
      <button type="button" class="btn btn-default">Middle</button>  
      <button type="button" class="btn btn-default">Right</button>  
    </div>

4.運行,查看效果 這些按鈕變成Bootstrap按鈕群組了

#

以上是vue能用bootstrap嗎的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn