####### 通过npm安装jquery
npm install jquery -D

然后配置webpack-config.js
plugins: [
        new webpack.ProvidePlugin({
            $: "jquery",
            jQuery: "jquery",
            "window.jQuery": "jquery"
        })
    ],

然后在全局中就可以直接使用$了

相关文章:

  • 2022-12-23
  • 2022-02-04
  • 2021-07-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-10
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-05
  • 2022-12-23
  • 2022-12-23
  • 2021-09-09
  • 2021-09-07
相关资源
相似解决方案