vue引入jquery
1、安装jquery
npm i jquery -D
2、在webpack.base.conf.js里加入
var webpack = require("webpack")
3、在文件babel.config.js中的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'

浙公网安备 33010602011771号