小编Syl*_*kFr的帖子

如何在 UI5 1.38 中重用另一个应用程序的组件?

环境

框架:SAPUI5 V1.38.39
IDE:SAP WEB IDE

问题

我想在另一个应用程序中使用 SAPUI5 应用程序,为此我找到了以下资源:https ://blogs.sap.com/2017/04/05/sapui5-how-to-reuse-parts-of- a-sapui5-application-in-othermultiple-sapui5-applications/

来自我想重用另一个应用程序的代码

在 init 中的 component.js 中我使用了:

var sPath = sHostUrl.includes("webidetesting") ? "https://gtyext.net" : sHostUrl;
jQuery.sap.registerModulePath("ztntapp", `${sPath}/sap/bc/ui5_ui5/sap/ztntapp/`);
Run Code Online (Sandbox Code Playgroud)

在我看来:

<core:ComponentContainer 
    name="ztntapp" 
    manifestFirst="true" 
    component="ztntapp">
</core:ComponentContainer>
Run Code Online (Sandbox Code Playgroud)

并在 neo-app.json 中

{
    "path": "/sap/bc/ui5_ui5/sap/ztntapp/",
    "target": {
        "type": "destination",
        "name": "gtyext_net",
        "entryPath": "/sap/bc/ui5_ui5/sap/ztntapp/"
    },
    "description": "namespace.tntapp Resources"
}
Run Code Online (Sandbox Code Playgroud)

来自重用应用程序的代码

在 component.js 中

sap.ui.define([
    "sap/ui/core/UIComponent",
    "sap/ui/Device",
    "./model/models"
], function (UIComponent, Device, models) {
    "use strict";

    return UIComponent.extend("TrackAndTrace.ztntapp.Component", {

        metadata: {
            manifest: "json"
        },
        init: function …
Run Code Online (Sandbox Code Playgroud)

sapui5 sap-fiori sap-web-ide sap-cloud-platform

7
推荐指数
1
解决办法
749
查看次数