1、安裝jquery
npm install?jquery --save-dev
2傲茄、vue.config.js中配置如下:
module.exports?=?{
configureWebpack:?{
?new?webpack.ProvidePlugin({
????????$:"jquery",
????????jQuery:"jquery",
????????"windows.jQuery":"jquery"
??????})
}
}
3震缭、在main.js中引入,就可以在代碼中識別出$了
import?$?from?'jquery';