如何在UI5中实现重用组件?

时间:2018-07-20 07:15:06

标签: sapui5

我想在ui5应用程序中使用Classification组件。

该组件的结构如下:

enter image description here

我想选择分类组件。 Component-dbg.js的内容如下:

sap.ui.define([
    "sap/ui/core/UIComponent",
    "sap/suite/ui/generic/template/extensionAPI/ReuseComponentSupport",
    "sap/suite/ui/generic/template/extensionAPI/UIMode",
    "sap/i2d/lo/lib/vchclf/common/Constants",
    "sap/i2d/lo/lib/vchclf/components/classification/service/ClassificationService"
], function(UIComponent, ReuseComponentSupport, UIMode, Constants, ClassificationService) {
    "use strict";

    /**
     * Classification Component.
     * @class ClassificationComponent
     * @extends sap.ui.core.UIComponent
     */
    return UIComponent.extend("sap.i2d.lo.lib.vchclf.components.classification.Component", {
        metadata: {
            manifest: "json",
            properties: {
                uiMode: {
                    type: "string",
                    group: "standard",
                    defaultValue: "Display"

我想在我的应用中使用它,并尝试如下绑定到manifest文件中:

    "dependencies": {
        "minUI5Version": "1.30.0",
        "libs": {
            "sap.ui.layout": {},
            "sap.ui.core": {},
            "sap.m": {}
        },
        "components": {
            "sap.i2d.lo.lib.vchclf.components.classification": {}
        }
    },
    "componentUsages": {
        "classcomponent": {
            "name": "sap.i2d.lo.lib.vchclf.components.classification"
        }
    }, 

我遇到以下错误:

Uncaught Error: failed to load 'sap/i2d/lo/lib/vchclf/components/classification/Component.js' from ../../resources/sap/i2d/lo/lib/vchclf/components/classification/Component.js: 404 - Not Found

我在做什么错了?

更新

我也尝试过:

<mvc:View controllerName="ch.mindustrie.CLASSIFICATION.controller.App" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:mvc="sap.ui.core.mvc"
    displayBlock="true" xmlns="sap.m" xmlns:core="sap.ui.core">
    <App id="idAppControl">
        <pages>
            <Page title="{i18n>title}">
                <content>
                    <core:ComponentContainer id="classificationComponentContainer" name="sap.i2d.lo.lib.vchclf.components.classification" propagateModel="true"/>
                </content>
            </Page>
        </pages>
    </App>
</mvc:View>

,还收到错误消息: enter image description here

0 个答案:

没有答案