问题标签 [golden-layout]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
19 浏览

javascript - 如何在嵌套回调中引用正确的“this”

在下面的代码中,我this.listercreate_components方法中得到了未定义的引用。我试图理解this(显然根据您调用该方法的方式而变化)的含义,但如果有人能指出为什么this不绑定到的规则ScreenCreator以及我如何实现这一点,那就太好了。

谢谢!