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

SAP UI5 walkthrough step6 Modules

在SAPUI5 中,资源通常用作Modules,这个我们将用Message Toast 来实现告警功能

修改controller.js

webapp/controller/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() {MessageToast.show("Hello World");}});
});

Conventions

  • Use sap.ui.define for controllers and all other JavaScript modules to define a global namespace. With the namespace, the object can be addressed throughout the application.

  • Use sap.ui.require for asynchronously loading dependencies but without declaring a namespace, for example code that just needs to be executed, but does not need to be called from other code.

  • Use the name of the artifact to load for naming the function parameters (without namespace).

实现效果如下:

http://www.lryc.cn/news/256244.html

相关文章:

  • 时间相关类
  • 数据库事务:保障数据一致性的基石
  • 自动化操作脚本
  • MVC、MVP、MVVM模式的区别
  • 【Vue】日常错误总结(持续更新)
  • java多线程(常用方法、实现方式、线程安全问题、生命周期、线程池)
  • Day05 linux高级系统设计 - 管道
  • 低代码:美味膳食或垃圾食品?
  • 免费网页抓取工具大全【附下载和工具使用教程】
  • Leetcode 39 组合总和
  • Windows下使用AndroidStudio及CMake编译Android可执行程序或静态库动态库
  • MySQL七 | 存储引擎
  • 网上下载的pdf文件,为什么不能复制文字?
  • Linux下apisix离线安装教程
  • 基于STM32 + DMA介绍,应用和步骤详解(ADC多通道)
  • openGauss学习笔记-144 openGauss 数据库运维-例行维护-慢sql诊断
  • 计算机毕业设计springboot+ssm停车场车位预约系统java
  • 打破常规思维:Scrapy处理豆瓣视频下载的方式
  • 系列学习前端之第 2 章:一文精通 HTML
  • SCSS Module 这样处理配置和使用太赞了
  • 【Unity动画】Unity 2D动画创建流程
  • 【算法每日一练]-图论(保姆级教程篇12 tarjan篇)#POJ3352道路建设 #POJ2553图的底部 #POJ1236校园网络 #缩点
  • Python数据科学视频讲解:数据挖掘与建模的注意事项
  • unity | 动画模块之循环滚动选项框
  • TinyMPC - CMU (卡耐基梅隆大学)开源的机器人 MPC 控制器
  • C++ 对象的初始化和清理:构造函数和析构函数
  • Tmux中使用Docker报错 - 解决方案
  • 如何在WordPress中批量替换图片路径?
  • el-pagination 纯前端分页
  • 基于springboot的校园二手市场