【发布时间】:2026-01-13 03:55:01
【问题描述】:
sap.ui.define([
"sap/ui/core/UIComponent",
"sap/ui/Device",
"RoutNav/model/models"
], function (UIComponent, Device, models) {
"use strict";
return UIComponent.extend("RoutNav.Component", {
metadata: {
manifest: "json",
rootView: "RoutNav.view.View1",
routes: [
{
pattern: "",
name: "Master",
view: "Master",
targetAggregation: "masterPages",
targetControl: "idAppControl",
subroutes: [
{
pattern: "tab:",
name: "Detail",
view: "Detail"
}
]
}
]
},
/**
* The component is initialized by UI5 automatically during the startup of the app and calls the init method once.
* @public
* @override
*/
init: function () {
// call the base component's init function
UIComponent.prototype.init.apply(this, arguments);
// set the device model
this.setModel(models.createDeviceModel(), "device");
}
});
});
我已经尝试过了,在master.view.xml 页面中我刚刚给出了一个标题。它不工作。
【问题讨论】:
-
完全不清楚你在问什么。您添加的代码不包含任何导航。您能否添加一个像 JSFiddle 或 Plunker 这样的工作示例来显示您的代码?
标签: sapui5