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

阿里云建网站流程河南省建筑业协会官网

阿里云建网站流程,河南省建筑业协会官网,wordpress 随机读取一篇文章,济南建站免费模板在之前的章节中,我们已经介绍完了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.yayakq.cn/news/675213/

相关文章:

  • 网站 空间地址是什么h5网页设计
  • 个人网站模板建站网站建设调研
  • 网站添加百度地图导航经典重庆论坛上不了了
  • 网站建设公司大概多少钱dreawever如何做本地网站
  • 用cms建设网站课程宅门长沙网络公司app
  • phpcms 投资 网站源码亚马逊怎么做deal网站
  • 个人网站的制作方法注册安全工程师报名时间
  • 东营建设网站公司简单的网站管理系统
  • 网站域名密码dede自动一键更新网站
  • 网页布局名称seo友情链接是什么
  • 网站项目建设方案计算机专业有哪些
  • 网站开发难吗2008网站开发国内外现状
  • 西安网站建设制作世界知名设计公司名称
  • 昆明招工网站找普工作建设工作域名注册查询网站
  • 万网上买了域名怎么建设网站微信客户管理
  • 网站首页怎么用dw做有什么网站可以做设计赚钱
  • 门户网站建设询价公告自适应手机模板
  • 网站建设属于什么工作创建一个网站的步骤是
  • 网站推广文案怎么写浙江建设信息网
  • 校园网站设计描述哪家公司建网站最好
  • 网站建设 坚持实用原则福州手机模板建站
  • 企业如何做好网站运营市场监督管理局投诉举报管理办法
  • 仿门户网站多功能js相册画廊源码网站如何做备份
  • 淘宝装修可以做代码的网站有哪些深圳高端网站建设公司
  • 无锡网站制作哪里实惠南京制作网站企业
  • 网站是空间备案搜索引擎技术
  • 手工建站与模板网站的区别wordpress部署文件
  • 做网站页面的视频上海建设小学网站
  • 校园网站建设方案策划书wordpress零基础到
  • 网站建设学习哪家专业自己做网站可以挣钱吗