SAPUI5 WalkThrough Step 3: Controls

https://sapui5.hana.ondemand.com/#/topic/ddbceecd7d3d42eea9cf78a820a238fb

使用sapui5中的 sap.m.Text 控件,显示 “Hello World”

 

1、修改index.html文件中的<body> </body>标签, 设置ID为“content”

<body class="sapUiBody" id="content">
</body>

 

2、在index.js文件中, 用js代码创建一个 sap.m.Text控件,其text属性为“Hello World”

sap.ui.define([
    "sap/m/Text"

], function (Text) {
    "use strict";

    new Text({
        text: "Hello World"
    }).placeAt("content");

});

关于 sap.m.Text 控件的介绍,可以查看API文档 https://sapui5.hana.ondemand.com/#/api/sap.m.Text 

控件对应的Demo程序,可参考 https://sapui5.hana.ondemand.com/#/entity/sap.m.Text

 

 执行结果

 

posted @ 2021-07-13 17:34  客于溟  阅读(178)  评论(0)    收藏  举报