我试图在 SAPUI5 应用程序中实现 Component.js,但无法理解下面代码中的.extend 和 .prototype.init.apply 方法。
sap.ui.define([
"sap/ui/core/UIComponent"
], function (UIComponent) {
"use strict";
return UIComponent.extend(""** , {**
init: function () {
UIComponent.prototype.init.apply(this, arguments);
// console.log(UIComponent.extend);
UIComponent.prototype.init.apply(this, arguments);
}
});
});
Run Code Online (Sandbox Code Playgroud)
有人可以解释一下吗?
PS 我是 OO Javascript 的初学者。