未定义路由器或目标&san.f.routing.Router'的指定类 [英] The specified class for router or targets 'sap.f.routing.Router' is undefined

查看:18
本文介绍了未定义路由器或目标&san.f.routing.Router'的指定类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用https://experience.sap.com/fiori-design-web/flexible-column-layout/,收到以下错误消息:

清单文件上的路由器配置:

{
  "_version":"1.9.0",
  "sap.app":{
    "id":"ch.mindustrie.ZMM_CLASSIFICATION",
    "type":"application",
    "i18n":"i18n/i18n.properties",
    "applicationVersion":{
      "version":"0.1.0"
    },
    "title":"{{appTitle}}",
    "description":"{{appDescription}}",
    "sourceTemplate":{
      "id":"servicecatalog.connectivityComponentForManifest",
      "version":"0.0.0"
    },
    "dataSources":{
      "ZMM_CLASSIFICATION_SRV":{
        "uri":"/sap/opu/odata/sap/ZMM_CLASSIFICATION_SRV/",
        "type":"OData",
        "settings":{
          "odataVersion":"2.0",
          "localUri":"localService/ZMM_CLASSIFICATION_SRV/metadata.xml"
        }
      }
    }
  },
  "sap.ui":{
    "technology":"UI5",
    "icons":{
      "icon":"",
      "favIcon":"",
      "phone":"",
      "phone@2":"",
      "tablet":"",
      "tablet@2":""
    },
    "deviceTypes":{
      "desktop":true,
      "tablet":true,
      "phone":true
    },
    "supportedThemes":[
      "sap_hcb",
      "sap_belize"
    ]
  },
  "sap.ui5":{
    "handleValidation":true,
    "rootView":{
      "viewName":"ch.mindustrie.ZMM_CLASSIFICATION.view.App",
      "type":"XML",
      "async":true,
      "id":"app"
    },
    "dependencies":{
      "minUI5Version":"1.56.0",
      "libs":{
        "sap.ui.layout":{

        },
        "sap.ui.core":{

        },
        "sap.m":{

        }
      }
    },
    "contentDensities":{
      "compact":true,
      "cozy":true
    },
    "models":{
      "i18n":{
        "type":"sap.ui.model.resource.ResourceModel",
        "settings":{
          "bundleName":"ch.mindustrie.ZMM_CLASSIFICATION.i18n.i18n"
        }
      },
      "Classification":{
        "uri":"/sap/opu/odata/sap/ZMM_CLASSIFICATION_SRV/",
        "type":"sap.ui.model.odata.v2.ODataModel",
        "settings":{
          "defaultOperationMode":"Server",
          "defaultBindingMode":"OneWay",
          "defaultCountMode":"Request"
        },
        "dataSource":"ZMM_CLASSIFICATION_SRV",
        "preload":true
      }
    },
    "resources":{
      "css":[
        {
          "uri":"css/style.css"
        }
      ]
    },
    "routing":{
      "config":{
        "routerClass":"sap.f.routing.Router",
        "viewType":"XML",
        "viewPath":"ch.mindustrie.ZMM_CLASSIFICATION.view",
        "controlId":"idClassLayout",
        "bypassed":{
          "target":[
            "master"
          ]
        },
        "async":true
      },
      "routes":[
        {
          "pattern":"",
          "name":"search",
          "target":[
            "characteristic",
            "search"
          ],
          "layout":"TwoColumnsBeginExpanded"
        },
        {
          "pattern":"search/{classnum}/{classtype}",
          "name":"characteristic",
          "target":[
            "search",
            "characteristic"
          ],
          "layout":"TwoColumnsMidExpanded"
        }
      ],
      "targets":{
        "search":{
          "viewName":"Search",
          "viewLevel":1,
          "viewId":"search",
          "controlAggregation":"beginColumnPages"
        },
        "characteristic":{
          "viewName":"Characteristic",
          "viewLevel":2,
          "viewId":"characteristic",
          "controlAggregation":"endColumnPages"
        }
      }
    }
  },
  "sap.platform.abap":{
    "uri":"/sap/bc/ui5_ui5/sap/zmm_classifi/webapp",
    "_version":"1.1.0"
  }
}
它不能识别的sap.f.routing.Router是什么?我做错了什么?

推荐答案

为了使用路由器类"sap.f.routing.Router",需要预加载相应的库sap.f

manifest.json部分"sap.ui5"(针对基于组件的应用):

"dependencies" : {
  "libs": {
    "sap.ui.core": {},
    "sap.m": {},
    "sap.f": {},
    "sap.ui.layout": {}
  }
}

index.html中,否则:

<script id="sap-ui-bootstrap" src="..."
  data-sap-ui-libs="sap.ui.core,sap.m,sap.f,sap.ui.layout"
  data-sap-ui-async="true"
  ...
></script>

请记住,sap.f中的路由器类从UI5 1.46开始提供。

Ctrl+Shift+Left Alt+P或在浏览器控制台中输入sap.ui.version以查看该应用运行的是哪个UI5核心版本。

这篇关于未定义路由器或目标&san.f.routing.Router&#39;的指定类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆