1、安装jquery
npm i jquery -D
2、在webpack.base.conf.js里加入
var webpack = require("webpack")
3、在module.exports的最后加入
plugins: [
new webpack.optimize.CommonsChunkPlugin('common.js'),
new webpack.ProvidePlugin({
jQuery: "jquery",
$: "jquery"
})
]
4、然后一定要重新
npm run dev
5、在main.js 引入jquery
import $ from 'jquery'
标签:jquery,npm,vue,js,webpack,引入,new From: https://www.cnblogs.com/helloStone/p/16904018.html