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

游戏开发物语破解版优化设计方法

游戏开发物语破解版,优化设计方法,ftp服务器软件,网站建设目录结构设计在之前的章节中,我们已经介绍完了MVC的架构和实现,现在我们来讲一下,SAPUI5的结构 这一步,我们将所有的UI资产从index.html里面独立封装在一个组件里面 这样组件就变得独立,可复用了。这样,无所什么时候我…

在之前的章节中,我们已经介绍完了MVC的架构和实现,现在我们来讲一下,SAPUI5的结构

这一步,我们将所有的UI资产从index.html里面独立封装在一个组件里面

这样组件就变得独立,可复用了。这样,无所什么时候我们去访问资源的时候,我们都直接访问组件文件而不是index.html。这种方式使得我们的app变得更加灵活

文件拆分之后长这样

首先,我们先新建一个Component.js

webapp/Component.js (New)

sap.ui.define(["sap/ui/core/UIComponent"
], (UIComponent) => {"use strict";return UIComponent.extend("", {init() {// call the init function of the parentUIComponent.prototype.init.apply(this, arguments);}});
});
sap.ui.define(["sap/ui/core/UIComponent","sap/ui/model/json/JSONModel","sap/ui/model/resource/ResourceModel"
], (UIComponent, JSONModel, ResourceModel) => {"use strict";return UIComponent.extend("ui5.walkthrough.Component", {metadata : {"interfaces": ["sap.ui.core.IAsyncContentCreation"],"rootView": {"viewName": "ui5.walkthrough.view.App","type": "XML","id": "app"}},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 i18n modelconst i18nModel = new ResourceModel({bundleName: "sap.ui.demo.walkthrough.i18n.i18n"});this.setModel(i18nModel, "i18n");}});
});

接下来,我们去修改App.controller.js

sap.ui.define(["sap/ui/core/mvc/Controller","sap/m/MessageToast"
], (Controller, MessageToast) => {"use strict";return Controller.extend("ui5.walkthrough.controller.App", {onShowHello() {// read msg from i18n modelconst oBundle = this.getView().getModel("i18n").getResourceBundle();const sRecipient = this.getView().getModel().getProperty("/recipient/name");const sMsg = oBundle.getText("helloMsg", [sRecipient]);// show messageMessageToast.show(sMsg);}});
});

修改index.js

webapp\index.js

sap.ui.define(["sap/ui/core/ComponentContainer"
], (ComponentContainer) => {"use strict";new ComponentContainer({name: "ui5.walkthrough",settings : {id : "walkthrough"},async: true}).placeAt("content");
});

Conventions

  • The component is named Component.js.

  • Together with all UI assets of the app, the component is located in the webapp folder.

  • The index.html file is located in the webapp folder if it is used productively.

最终实现效果还是和之前一样

http://www.yidumall.com/news/90328.html

相关文章:

  • 做推广网站文娱热搜榜
  • wordpress 右侧广告北京网站优化站优化
  • 网站代码开发上海百度推广官网
  • 太原做网站多少钱付费推广方式有哪些
  • 网站建设 黑龙江seo网站建设是什么意思
  • 关于政府网站的建设的意见网站的优化和推广方案
  • 做网站jijianjianzhan石家庄邮电职业技术学院
  • 建设一个微商的网站seo爱站网
  • 电子商务b2c网站java培训班学费一般多少
  • jquery图片效果网站百度应用
  • 陕西个人证书查询网seo查询站长工具
  • 网站建设公司业务跟不上网址提交百度
  • 十堰seo排名seo网站诊断分析报告
  • 网站优化北京哪家强?电商培训基地
  • 绍兴外贸网站建设重庆整站seo
  • 如何查询网站域名备案seo超级外链工具免费
  • 重庆企业站seogoogle下载app
  • 重庆传媒公司前十名郑州纯手工seo
  • 公益网站 做公益赚钱360推广登录平台
  • 厦门做网站软件网站优化排名操作
  • 为什么浏览器打开是2345网址导航天天seo站长工具
  • 怎么做网站赌博代理深圳最好的外贸seo培训
  • 做展示型网站多少钱百度推广怎么添加关键词
  • 视频网站开发步骤2021年关键词有哪些
  • 惠州做网站 百度优化怎么让付费网站免费
  • 哪个商城网站建设好创网站永久免费建站
  • 织梦贷款网站模板长沙seo行者seo09
  • 望城做网站搭建一个网站平台需要多少钱
  • 做美图 网站有哪些网络推广站
  • 长沙河西做网站爱站长工具综合查询