'sap.f.routing.Router'未定义。

2020-09-08 00:27发布

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


尊敬的专业人员,

我一直在获取"为路由器或目标指定的类'sap.f.routing.Router'未定义"。 而且无论如何都无法修复。 请在附件中找到我的manifest.json和component.json。 我已经声明了所有需要的库,但是卡在" UIComponent.prototype.init.apply(this,arguments)"行中,"为路由器或目标指定的类" sap.f.routing.Router"未定义。" 错误。

 sap.ui.define([
 " sap/ui/core/UIComponent",
 'sap/ui/model/json/JSONModel',
 " sap/ui/设备",
 'sap/f/library'
 ],函数(UIComponent,JSONModel,Device,fioriLibrary){
 "使用严格";


 返回UIComponent.extend(" com.zfio_financ_mng.Component",{


 元数据:{
 清单:" json",
 包括:[" css/style.css"],
 依赖项:{
 库:[" sap.m"," sap.ui.layout"," sap.ui.core"," sap.f.routing"," sap.uxap"],
 组件: []
 }
 },


 初始化:函数(){


 var mConfig = this.getMetadata()。getConfig();

 var sServiceUrl = mConfig.serviceConfig.serviceUrl;


//默认基本模型
 var oModel = new sap.ui.model.odata.ODataModel(sServiceUrl,{
 json:是的,
 loadMetadataAsync:true
 });
 oModel.setCountSupported(false);
 this.setModel(oModel); //应用oDatayı设置etmek图标


 var oModelApp = new JSONModel();
 this.setModel(oModelApp," appJSONModel");

 UIComponent.prototype.init.apply(this,arguments);
 var oRouter = this.getRouter();
 oRouter.attachBeforeRouteMatched(this._onBeforeRouteMatched,this);
 oRouter.initialize();
 },


 _onBeforeRouteMatched:函数(oEvent){

 var oModelApp = this.getModel(" appJSONModel"),
 sLayout = oEvent.getParameters()。arguments.layout;

 如果(!sLayout){
 sLayout = fioriLibrary.LayoutType.OneColumn;
 }

 oModelApp.setProperty("/img/layout",sLayout);
 }
 });
 });
 
 {
 " _version":" 1.12.0",
 " sap.app":{
 " id":" com.zfio_financ_mng",
 " type":"应用程序",
 " i18n":" i18n/i18n.properties",
 " applicationVersion":{
 " version":" 1.0.0"
 },
 " title":" {{appTitle}}",
 " description":" {{appDescription}}",
 " sourceTemplate":{
 " id":" servicecatalog.connectivityComponentForManifest",
 " version":" 0.0.0"
 },
 "数据源": {
 " ZFMBU_BUDGET_PLAN_SRV":{
 " uri":"/img/sap/opu/odata/sap/ZFMBU_BUDGET_PLAN_SRV/",
 " type":" OData",
 "设置":{
 " odataVersion":" 2.0",
 " localUri":" localService/metadata.xml"
 }
 }
 }
 },
 " sap.ui":{
 " technology":" UI5",
 "图标":{
 " icon":"",
 " favIcon":"",
 "电话": "",
 " phone @ 2":"",
 " tablet":"",
 " tablet @ 2":""
 },
 " deviceTypes":{
 "桌面":是的,
 "平板电脑":是的,
 "电话":正确
 }
 },
 " sap.ui5":{
 " flexEnabled":否,
 " rootView":{
 " viewName":" com.zfio_financ_mng.view.App",
 " type":" XML",
 "异步":是的,
 " id":" App"
 },
 " config":{
 " fullWidth":是,
 " resourceBundle":" i18n/i18n.properties",
 " serviceConfig":{
 "名称":" ZFMBU_BUDGET_PLAN_SRV",
 " serviceUrl":"/img/sap/opu/odata/sap/ZFMBU_BUDGET_PLAN_SRV/"
 }
 },
 "依赖关系":{
 " minUI5Version":" 1.60.1",
 " libs":{
 " sap.ui.layout":{},
 " sap.ui.core":{},
 " sap.m":{},
 " sap.f":{},
 " sap.uxap":{}
 }
 },
 " contentDensities":{
 "紧凑":是的,
 "舒适":是
 },
 "楷模": {
 " i18n":{
 " type":" sap.ui.model.resource.ResourceModel",
 "设置":{
 " bundleName":" com.zfio_financ_mng.i18n.i18n"
 }
 },
 " app":{
 " type":" sap.ui.model.json.JSONModel",
 "设置":{},
 " uri":" model/app.json"
 },
 "":{
 " type":" sap.ui.model.odata.v2.ODataModel",
 "设置":{
 " defaultOperationMode":"服务器",
 " defaultBindingMode":" OneWay",
 " defaultCountMode":"请求"
 },
 " dataSource":" ZFMBU_BUDGET_PLAN_SRV",
 " preload":是
 }
 },
 "资源":{
 " css":[
 {
 " uri":" css/style.css"
 }
 ]
 },
 "路由":{
 " config":{
 " routerClass":" sap.f.routing.Router",
 " viewType":" XML",
 " viewPath":" com.zfio_financ_mng.view",
 " controlId":" flexibleColumnLayout",
 " transition":" slide",
 "异步":true
 },
 "路线":[
 {
 " pattern":":layout:",
 " name":" master",
 "目标":[
 "主",
 "详情"
 ]
 },
 {
 " pattern":"详细信息/{entityDetail}/{layout}",
 " name":"详细信息",
 "目标":[
 "主",
 "详情"
 ]
 },
 {
 " pattern":"详细信息/{entityDetail}/detailDetail/{entityDetailDetail}/{layout}",
 " name":" detailDetail",
 "目标":[
 "主",
 "详情",
 " detailDetail"
 ]
 }
 ],
 "目标":{
 "主人":{
 " viewName":"大师",
 " controlAggregation":" beginColumnPages"
 },
 "详细信息":{
 " viewName":"详细信息",
 " controlAggregation":" midColumnPages"
 },
 " detailDetail":{
 " viewName":" DetailDetail",
 " controlAggregation":" endColumnPages"
 }
 }
 }
 },
 " sap.platform.abap":{
 " uri":"/img/sap/bc/ui5_ui5/sap/zfio_financ_mng/webapp",
 " _version":" 1.1.0"
 }
 } 

1.jpg (65.5 kB)

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


尊敬的专业人员,

我一直在获取"为路由器或目标指定的类'sap.f.routing.Router'未定义"。 而且无论如何都无法修复。 请在附件中找到我的manifest.json和component.json。 我已经声明了所有需要的库,但是卡在" UIComponent.prototype.init.apply(this,arguments)"行中,"为路由器或目标指定的类" sap.f.routing.Router"未定义。" 错误。

 sap.ui.define([
 " sap/ui/core/UIComponent",
 'sap/ui/model/json/JSONModel',
 " sap/ui/设备",
 'sap/f/library'
 ],函数(UIComponent,JSONModel,Device,fioriLibrary){
 "使用严格";


 返回UIComponent.extend(" com.zfio_financ_mng.Component",{


 元数据:{
 清单:" json",
 包括:[" css/style.css"],
 依赖项:{
 库:[" sap.m"," sap.ui.layout"," sap.ui.core"," sap.f.routing"," sap.uxap"],
 组件: []
 }
 },


 初始化:函数(){


 var mConfig = this.getMetadata()。getConfig();

 var sServiceUrl = mConfig.serviceConfig.serviceUrl;


//默认基本模型
 var oModel = new sap.ui.model.odata.ODataModel(sServiceUrl,{
 json:是的,
 loadMetadataAsync:true
 });
 oModel.setCountSupported(false);
 this.setModel(oModel); //应用oDatayı设置etmek图标


 var oModelApp = new JSONModel();
 this.setModel(oModelApp," appJSONModel");

 UIComponent.prototype.init.apply(this,arguments);
 var oRouter = this.getRouter();
 oRouter.attachBeforeRouteMatched(this._onBeforeRouteMatched,this);
 oRouter.initialize();
 },


 _onBeforeRouteMatched:函数(oEvent){

 var oModelApp = this.getModel(" appJSONModel"),
 sLayout = oEvent.getParameters()。arguments.layout;

 如果(!sLayout){
 sLayout = fioriLibrary.LayoutType.OneColumn;
 }

 oModelApp.setProperty("/img/layout",sLayout);
 }
 });
 });
 
 {
 " _version":" 1.12.0",
 " sap.app":{
 " id":" com.zfio_financ_mng",
 " type":"应用程序",
 " i18n":" i18n/i18n.properties",
 " applicationVersion":{
 " version":" 1.0.0"
 },
 " title":" {{appTitle}}",
 " description":" {{appDescription}}",
 " sourceTemplate":{
 " id":" servicecatalog.connectivityComponentForManifest",
 " version":" 0.0.0"
 },
 "数据源": {
 " ZFMBU_BUDGET_PLAN_SRV":{
 " uri":"/img/sap/opu/odata/sap/ZFMBU_BUDGET_PLAN_SRV/",
 " type":" OData",
 "设置":{
 " odataVersion":" 2.0",
 " localUri":" localService/metadata.xml"
 }
 }
 }
 },
 " sap.ui":{
 " technology":" UI5",
 "图标":{
 " icon":"",
 " favIcon":"",
 "电话": "",
 " phone @ 2":"",
 " tablet":"",
 " tablet @ 2":""
 },
 " deviceTypes":{
 "桌面":是的,
 "平板电脑":是的,
 "电话":正确
 }
 },
 " sap.ui5":{
 " flexEnabled":否,
 " rootView":{
 " viewName":" com.zfio_financ_mng.view.App",
 " type":" XML",
 "异步":是的,
 " id":" App"
 },
 " config":{
 " fullWidth":是,
 " resourceBundle":" i18n/i18n.properties",
 " serviceConfig":{
 "名称":" ZFMBU_BUDGET_PLAN_SRV",
 " serviceUrl":"/img/sap/opu/odata/sap/ZFMBU_BUDGET_PLAN_SRV/"
 }
 },
 "依赖关系":{
 " minUI5Version":" 1.60.1",
 " libs":{
 " sap.ui.layout":{},
 " sap.ui.core":{},
 " sap.m":{},
 " sap.f":{},
 " sap.uxap":{}
 }
 },
 " contentDensities":{
 "紧凑":是的,
 "舒适":是
 },
 "楷模": {
 " i18n":{
 " type":" sap.ui.model.resource.ResourceModel",
 "设置":{
 " bundleName":" com.zfio_financ_mng.i18n.i18n"
 }
 },
 " app":{
 " type":" sap.ui.model.json.JSONModel",
 "设置":{},
 " uri":" model/app.json"
 },
 "":{
 " type":" sap.ui.model.odata.v2.ODataModel",
 "设置":{
 " defaultOperationMode":"服务器",
 " defaultBindingMode":" OneWay",
 " defaultCountMode":"请求"
 },
 " dataSource":" ZFMBU_BUDGET_PLAN_SRV",
 " preload":是
 }
 },
 "资源":{
 " css":[
 {
 " uri":" css/style.css"
 }
 ]
 },
 "路由":{
 " config":{
 " routerClass":" sap.f.routing.Router",
 " viewType":" XML",
 " viewPath":" com.zfio_financ_mng.view",
 " controlId":" flexibleColumnLayout",
 " transition":" slide",
 "异步":true
 },
 "路线":[
 {
 " pattern":":layout:",
 " name":" master",
 "目标":[
 "主",
 "详情"
 ]
 },
 {
 " pattern":"详细信息/{entityDetail}/{layout}",
 " name":"详细信息",
 "目标":[
 "主",
 "详情"
 ]
 },
 {
 " pattern":"详细信息/{entityDetail}/detailDetail/{entityDetailDetail}/{layout}",
 " name":" detailDetail",
 "目标":[
 "主",
 "详情",
 " detailDetail"
 ]
 }
 ],
 "目标":{
 "主人":{
 " viewName":"大师",
 " controlAggregation":" beginColumnPages"
 },
 "详细信息":{
 " viewName":"详细信息",
 " controlAggregation":" midColumnPages"
 },
 " detailDetail":{
 " viewName":" DetailDetail",
 " controlAggregation":" endColumnPages"
 }
 }
 }
 },
 " sap.platform.abap":{
 " uri":"/img/sap/bc/ui5_ui5/sap/zfio_financ_mng/webapp",
 " _version":" 1.1.0"
 }
 } 

1.jpg (65.5 kB)
付费偷看设置
发送
1条回答
空代码
1楼-- · 2020-09-08 00:59

为什么使用sap.f lib?

如何创建项目?

一周热门 更多>