优茬娱乐网
您的当前位置:首页vue中怎么引入bootstrap

vue中怎么引入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' ;
显示全文