首页 > 解决方案 > 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.jsUIComponent.prototype.init.apply(this, arguments); 请帮助。

问候,列夫。

标签: javascriptsapui5

解决方案


问题是init函数是以这种方式声明的:init => () {}. 在将其转换为常规函数(我的意思是init: function (){})之后,一切都变得很好。


推荐阅读