一、安装jQuery
npm install jquery --save //安装jQuery
二、配置jQuery
configureWebpack: {
plugins: [
new webpack.ProvidePlugin({
$: "jquery",
jquery: "jquery",
jQuery: "jquery",
"windows.jQuery": "jquery",
}),
],
},
三、使用jQuery
import $ from "jquery";
就没了