javascript - OpenUI5:TypeError:this.getAutoPrefixId 不是函数
问题描述
我正在 OpenUI5+NodeJS 上编写一个小应用程序。当我打电话时index.html
,我在浏览器的控制台中出现以下错误:TypeError: this.getAutoPrefixId is not a function
. 堆栈跟踪的顶部如下:
init sap-ui-core.js line 175
init Component.js:19
constructor ManagedObject-dbg.js:444
constructor ManagedObject-dbg.js:463
constructor Component-dbg.js:244
线路init Component.js:19
来自我的Component.js
:UIComponent.prototype.init.apply(this, arguments);
请帮助。
问候,列夫。
解决方案
问题是init
函数是以这种方式声明的:init => () {}
. 在将其转换为常规函数(我的意思是init: function (){}
)之后,一切都变得很好。
推荐阅读
- java - 从字符串变量中的休息服务获取异常
- javascript - Javascript Date 对象未显示正确的月份
- c# - EF Core SQLITE - SQLite 错误 19:'UNIQUE 约束失败
- python - 将 Python 添加到 Windows 路径
- javascript - String .replace() does not work with '$' symbol
- ios - 将 alpha 设置为 0.0 后无法点击 UIButton,即使重置为 1.0
- openid - OpenID Connect 授权码字符串的格式是什么?
- vhdl - 在 VHDL 中使用 VARIABLE 时从不使用输入问题
- django - 如何在 Django admin 的字段中生成时间戳作为默认值
- powershell - 使用 Credentials 和 ArgumentList 以另一个用户身份启动进程