转载请联系vx:xiaoshitou5854
引入Control,sap/m/Text就是UI5里的Controller,初始化Text对象,设置text属性为Hello World,并替换index.html里的id为content的DOM节点。
webapp/index.js
sap.ui.define([
"sap/m/Text"
], function (Text) {
"use strict";
new Text({
text: "Hello World"
}).placeAt("content");
});
webapp/index.html:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>SAPUI5 Walkthrough</title>
<script
id="sap-ui-bootstrap"
src="https://openui5.hana.ondemand.com/resources/sap-ui-core.js"
data-sap-ui-theme="sap_belize"
data-sap-ui-libs="sap.m"
data-sap-ui-compatVersion="edge"
data-sap-ui-async="true"
data-sap-ui-onInit="module:sap/ui/demo/walkthrough/index"
data-sap-ui-resourceroots='{
"sap.ui.demo.walkthrough": "./"
}'>
</script>
</head>
<body class="sapUiBody" id="content">
</body>
</html>
本人微信:xiaoshitou5854