用electron写桌面程序时

ui部分的html页面引入的js会用到jquery

用常规的方式引入是不行的,会抛出如题的异常

<script type="text/javascript" src="js/jquery.1.10.2.js"></script>

需要在页面中加入

<script>window.$ = window.jQuery = require('./js/jquery.1.10.2.js');</script>

其中路径根据你的实际情况进行替换

参见 https://discuss.atom.io/t/uncaught-error-cannot-find-module-jquery/20429

相关文章:

  • 2021-09-23
  • 2022-12-23
  • 2021-09-16
  • 2021-09-15
  • 2021-06-16
  • 2022-12-23
猜你喜欢
  • 2021-10-25
  • 2021-04-27
  • 2021-04-21
  • 2021-06-30
  • 2022-12-23
  • 2021-07-11
相关资源
相似解决方案