SAP UI5 Routing 路由介绍

简介: 官网链接:https://sapui5.hana.ondemand.com/1.36.6/docs/guide/e5200ee755f344c8aef8efcbab3308fb.html

官网链接:https://sapui5.hana.ondemand.com/1.36.6/docs/guide/e5200ee755f344c8aef8efcbab3308fb.html


一个例子:

"routing": {
      "config": {
        "routerClass": "sap.m.routing.Router",
        "viewType": "XML",
        "viewPath": "kyma.sample.app.view",
        "controlId": "app",
        "controlAggregation": "pages",
        "async": true
      },
      "routes": [
        {
          "pattern": "",
          "name": "orders",
          "target": ["orders"]
        }
      ],
      "targets": {
        "orders": {
          "viewName": "Orders",
          "viewId": "orders",
          "viewLevel": 1,
          "title": "{i18n>title}"
        }
      }

image.png



在 manifest.json 文件的 sap.ui5 区域,添加了三个子区域:


(1) config

(2) routes

(3) target


config

This section contains the global router configuration and default values that apply for all routes and targets.


包含了全局路由器信息和适应于所有路由路径和目标的默认值。


We define the router class that we want to use and where our views are located in the app.


定义了路由器实现类以及我们的视图在应用中的具体位置。


To load and display views automatically, we also specify which control is used to display the pages and what aggregation should be filled when a new page is displayed.


为了让视图能够显示出来,需要定义哪个控件用于显示页面,以及页面通过何种 aggregation,填充到该控件去。



image.png



routes

Each route defines a name, a pattern, and one or more targets to navigate to when the route has been hit.


每条路由信息定义了一个名称,一个格式,以及一个路由目的视图,当该路由触发时,目的视图会显示。


The pattern is basically the URL part that matches to the route, we define two routes for our app.


所谓 pattern,即待匹配的 URL 片段。


例子:

image.png


image.png

相关文章
|
1月前
|
前端开发 搜索推荐 开发者
SAP UI5 sap.m.Column 控件的 minScreenWidth 属性介绍
SAP UI5 sap.m.Column 控件的 minScreenWidth 属性介绍
27 0
|
1月前
|
JavaScript 前端开发 开发者
SAP UI5 控件 sap.m.ListBase 的 inset 属性的作用介绍
SAP UI5 控件 sap.m.ListBase 的 inset 属性的作用介绍
13 0
|
1月前
|
Web App开发 数据采集 前端开发
纯技术讨论:如何让 SAP UI5 应用无法被别人在浏览器里调试 - 这种做法不推荐试读版
纯技术讨论:如何让 SAP UI5 应用无法被别人在浏览器里调试 - 这种做法不推荐试读版
15 0
|
1月前
|
XML 存储 数据格式
SAP UI5 控件 customData 属性的应用介绍
SAP UI5 控件 customData 属性的应用介绍
31 0
|
1月前
|
前端开发 JavaScript API
SAP UI5 sap.ui.require.toUrl 的作用介绍
SAP UI5 sap.ui.require.toUrl 的作用介绍
28 0
|
1月前
|
搜索推荐
如何让 SAP UI5 Smart Table 支持多项选择(Multiple-Selection)试读版
如何让 SAP UI5 Smart Table 支持多项选择(Multiple-Selection)试读版
18 0
|
1月前
使用 SAP UI5 Event Bus 机制,修复 SAP UI5 分页显示数据的一个 bug 试读版
使用 SAP UI5 Event Bus 机制,修复 SAP UI5 分页显示数据的一个 bug 试读版
20 0
|
1月前
|
开发者 UED
SAP UI5 SmartFilterBar 中 ControlConfiguration Aggregation 的作用介绍
SAP UI5 SmartFilterBar 中 ControlConfiguration Aggregation 的作用介绍
14 0
|
1月前
|
开发者 UED
关于 SAP UI5 sap.m.Column 的 demandPopin 属性
关于 SAP UI5 sap.m.Column 的 demandPopin 属性
15 0
|
1月前
SAP UI5 Link 控件的使用方法介绍 - 后续学习 Fiori Elements Smart Link 的基础试读版
SAP UI5 Link 控件的使用方法介绍 - 后续学习 Fiori Elements Smart Link 的基础试读版
15 0

热门文章

最新文章