当前位置: 首页 > wzjs >正文

2018网站建设行业汕头自动seo

2018网站建设行业,汕头自动seo,淘宝客怎样做自己的网站推广,上海seo网站优化软件上一章讲了Fiori开发中的 Responsiveness(响应式设计)。 SAP学习笔记 - 开发30 - 前端Fiori开发 Responsiveness(响应式设计)-CSDN博客 本章继续学习Fiori 开发中的知识。 目录 1,Device Adaptation(设备…

上一章讲了Fiori开发中的 Responsiveness(响应式设计)。

SAP学习笔记 - 开发30 - 前端Fiori开发 Responsiveness(响应式设计)-CSDN博客

本章继续学习Fiori 开发中的知识。

目录

1,Device Adaptation(设备自适应)

1),HelloPanel.view.xml

2),Component.js

3),运行看效果

4),Detail.view.xml

5),Detail.controller.js 

6),运行看效果


下面是详细内容。

1,Device Adaptation(设备自适应)

SAPUI5 SDK - Demo Kit

先来看一下具体改了什么文件,达到了什么效果。 

简单来说就是实现折叠一部分组件,以节约空间。

1),HelloPanel.view.xml

<mvc:ViewcontrollerName="ui5.walkthrough.controller.HelloPanel"xmlns="sap.m"xmlns:mvc="sap.ui.core.mvc"><PanelheaderText="{i18n>helloPanelTitle}"class="sapUiResponsiveMargin"width="auto"expandable="{device>/system/phone}"expanded="{= !${device>/system/phone} }"><content><Buttonid="helloDialogButton"icon="sap-icon://world"text="{i18n>openDialogButtonText}"press=".onOpenDialog"class="sapUiSmallMarginEnd sapUiVisibleOnlyOnDesktop"/><Buttontext="{i18n>showHelloButtonText}"press=".onShowHello"class="myCustomButton"/><Inputvalue="{/recipient/name}"valueLiveUpdate="true"width="60%"/><FormattedTexthtmlText="Hello {/recipient/name}"class="sapUiSmallMargin sapThemeHighlight-asColor myCustomText"/></content></Panel>
</mvc:View>

在Panel 组件里面,用下面属性来启动自适应:

- expandable="{device>/system/phone}" =》在设备为 phone 的时候,会启用折叠
- expanded="{= !${device>/system/phone} }"> =》该状态指明该部分是否已经处于折叠状态

- sapUiVisibleOnlyOnDesktop =》该CSS 样式用于只显示于Desktop 模式下

2),Component.js

sap.ui.define(["sap/ui/core/UIComponent","sap/ui/model/json/JSONModel","sap/ui/Device"
], (UIComponent, JSONModel, Device) => {"use strict";return UIComponent.extend("ui5.walkthrough.Component", {metadata: {interfaces: ["sap.ui.core.IAsyncContentCreation"],manifest: "json"},init() {// call the init function of the parentUIComponent.prototype.init.apply(this, arguments);// set data modelconst oData = {recipient: {name: "World"}};const oModel = new JSONModel(oData);this.setModel(oModel);// set device modelconst oDeviceModel = new JSONModel(Device);oDeviceModel.setDefaultBindingMode("OneWay");this.setModel(oDeviceModel, "device");// create the views based on the url/hashthis.getRouter().initialize();}});
});

- 指定Device Model为单向模式(默认是双向绑定) 

const oDeviceModel = new JSONModel(Device);
oDeviceModel.setDefaultBindingMode("OneWay");
this.setModel(oDeviceModel, "device");

3),运行看效果

其实就是指定一部分对象作为折叠对象,然后引入Device模块,之后SAP Fiori就全帮你干了。

好像没啥变化哈~

因为这是Desktop 中显示,咱们给调成 phone 模式显示

按 F12,然后调成 phone 模式

这样就会显示折叠

点一下可以展开折叠或再次折叠 

上面在列表上搞了个折叠,当是phone模式的时候,会自适应为折叠。

下面看看在明细画面也做下优化。

4),Detail.view.xml

<mvc:ViewcontrollerName="ui5.walkthrough.controller.Detail"xmlns="sap.m"xmlns:core="sap.ui.core"xmlns:mvc="sap.ui.core.mvc"xmlns:wt="ui5.walkthrough.control"><Pagetitle="{i18n>detailPageTitle}"showNavButton="true"navButtonPress=".onNavBack"><ObjectHeadercore:require="{Date: 'sap/ui/model/type/Date',Currency: 'sap/ui/model/type/Currency'}"responsive="true"fullScreenOptimized="true"number="{parts: ['invoice>ExtendedPrice','view>/currency'],type: 'Currency',formatOptions: {showMeasure: false}}"numberUnit="{view>/currency}"intro="{invoice>ShipperName}"title="{invoice>ProductName}"><attributes><ObjectAttributetitle="{i18n>quantityTitle}"text="{invoice>Quantity}"/><ObjectAttributetitle="{i18n>dateTitle}"text="{path: 'invoice>ShippedDate',type: 'Date',formatOptions: {style: 'long',source: {pattern: 'yyyy-MM-ddTHH:mm:ss'}}}"/></attributes></ObjectHeader><wt:ProductRatingid="rating"class="sapUiSmallMarginBeginEnd"change=".onRatingChange"/></Page>
</mvc:View>

- 通过两句就是启动 ObjectHeader 组件的自适应模式

responsive="true"
fullScreenOptimized="true"

- 那么自适应对象是谁呢?就是这个 <attributes> 部分。

  和上面在 HelloPanel.view.xml 作用在 panel 组件上,用的是不同的属性。

<attributes>
    <ObjectAttribute
        title="{i18n>quantityTitle}"
        text="{invoice>Quantity}"/>
    <ObjectAttribute
        title="{i18n>dateTitle}"
        text="{
            path: 'invoice>ShippedDate',
            type: 'Date',
            formatOptions: {
                style: 'long',
                source: {
                    pattern: 'yyyy-MM-ddTHH:mm:ss'
                }
            }
        }"/>
</attributes>

5),Detail.controller.js 

sap.ui.define(["sap/ui/core/mvc/Controller","sap/ui/core/routing/History","sap/m/MessageToast","sap/ui/model/json/JSONModel"
], (Controller, History, MessageToast, JSONModel) => {"use strict";return Controller.extend("ui5.walkthrough.controller.Detail", {onInit() {const oViewModel = new JSONModel({currency: "EUR"});this.getView().setModel(oViewModel, "view");const oRouter = this.getOwnerComponent().getRouter();oRouter.getRoute("detail").attachPatternMatched(this.onObjectMatched, this);},…});
});

这里没啥,就是为了在详细页面加几个字段,比如这个Currency,所以加的Model而已

6),运行看效果

点任意一条明细,显示下面画面

哦,我这个用的Remote Data,Order Date 在Meta Data 里没暴漏出来。

我再加一个字段,然后再看看。

默认Destop Web 是这样的:有几个字段是靠右的

调成 phone 模式之后,就变成这样的

其实就是适应手机屏幕尺寸,把一些字段给调在下面表示了 

官方资料里提供的是这两种方式,在实际开发当中还是挺常用的。

其他的肯定还有,官方暂时没提供Sample,以后有Sample再说。

以上就是本篇的全部内容。

更多SAP顾问业务知识请点击下面目录链接或东京老树根的博客主页

https://blog.csdn.net/shi_ly/category_12216766.html

东京老树根-CSDN博客

http://www.dtcms.com/wzjs/341739.html

相关文章:

  • 网站视频管理系统网站seo优化总结
  • 好的网站建站公司电脑优化软件
  • 宿州网站建设seo网站推广目的
  • 制作网站的基本步骤是重庆seo排名技术
  • 山西省财政厅门户网站三基建设搜狗搜索引擎入口
  • 加强政府门户网站建设讲话百度搜索app
  • html5网站动效怎么做如何设计网站的首页
  • 重庆手机网站建设专注于网站营销服务
  • 展示网站如何做建网站怎么赚钱
  • wordpress站添加根部单页打不开关键词代发排名
  • 台州找人做网站搜狗收录提交入口
  • 网站开发获取报价社群营销平台有哪些
  • 用asp.net做的网站贴吧创建一个网站
  • 购物商城网站制作国外搜索引擎优化
  • 长沙网站微信开发哪里有正规的电商培训班
  • 网站维护基础知识app开发用什么软件
  • 上海招聘网最新招聘信息网seo sem是什么职位
  • 常见的网站类型网站维护需要多长时间
  • 人力资源和社会保障部门户网站怎么建立企业网站
  • 网站规划方案模板南京seo
  • 手机建设银行网站首页搭建网站需要哪些步骤
  • 网址大全查询网站文案写作软件app
  • 能用网站做微信小程序网站关键词快速排名服务
  • 白云定制型网站建设软文营销经典案例
  • 广州app网站建设深圳网页搜索排名提升
  • 网站智能建设系统源码专业的google推广公司
  • 给新公司做网站要多少钱哪有免费的网站
  • 做设计需要知道的几个网站sem竞价培训班
  • cn域名有名的网站全媒体运营师培训
  • 网站淘客宝怎么做搜索引擎优化实训报告