首页 文章

无法在电子应用上加载Goldenlayout库

提问于
浏览
2

嗨,我正在尝试重新创建Golden Layout角度复杂应用程序https://golden-layout.com/tutorials/angular-complex.html作为电子应用程序,所以基本上我只是做了电子http://electron.atom.io/docs/latest/tutorial/quick-start/的快速启动示例,并在我的index.html上做了所有逻辑的黄金布局,但它发送给我这个错误:

jQuery缺少作为GoldenLayout的依赖项 . 在使用RequireJS / AMD时,请在GoldenLayout的范围(例如窗口)上公开$或在路径中添加“jquery”

1 回答

  • 2

    this answer所示,您需要以下列方式加载jquery(在包含golden-layout之前):

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

    如果我理解正确,出现问题是因为jquery 'detects'它在requireJS环境中运行并且在 modules 中加载 $jQuery (不是 window

相关问题