vue-cli中引入jquery方法

在webpack.base.conf.js里加入

var webpack = require("webpack")

在module.exports的最后加入

plugins: [

new webpack.ProvidePlugin({

jQuery: "jquery",

$: "jquery"

})

]

然后一定要重新npm  run dev

在main.js 引入就ok了import $ from 'jquery'

猜你喜欢

转载自blog.csdn.net/pansuyong/article/details/81097865