Error message: caught ReferenceError: jQuery is not defined
Cause Analysis:不详,本人前端处于幼儿园水平
Error screenshot:
Solution:
Add the two pieces of code in the red box to vue.config.js
const {
defineConfig } = require('@vue/cli-service')
const webpack = require("webpack");
module.exports = defineConfig({
transpileDependencies: true,
configureWebpack: {
plugins: [
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
"window.jQuery": "jquery",
"window.$": "jquery",
Popper: ["popper.js", "default"]
})
]
}
})