创建第一个OpenUI5应用

来源:互联网 发布:电脑怎么安装淘宝 编辑:程序博客网 时间:2024/05/23 09:39
<!DOCTYPE html><html><head>    <meta http-equiv="X-UA-Compatible" content="IE=edge" />    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>    <title>SAPUI5 in 20 Seconds</title>    <!-- 1.) Load SAPUI5 (from a remote server), select theme and control library -->    <script id="sap-ui-bootstrap"        src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"        data-sap-ui-theme="sap_bluecrystal"        data-sap-ui-libs="sap.ui.commons"></script>    <!-- 2.) Create a UI5 button and place it onto the page -->    <script>        // create the button instance        var myButton = new sap.ui.commons.Button("btn");        // set properties, e.g. the text (there is also a shorter way of setting several properties)        myButton.setText("Hello World!");        // attach an action to the button's "press" event (use jQuery to fade out the button)        myButton.attachPress(function(){$("#btn").fadeOut()});        // place the button into the HTML element defined below        myButton.placeAt("uiArea");        // an alternative, more jQuery-like notation for the same is:          /*        $(function(){            $("#uiArea").sapui("Button", "btn", {                text:"Hello World!",                press:function(){$("#btn").fadeOut();}            });         });         */     </script></head><body class="sapUiBody">    <!-- This is where you place the UI5 button -->    <div id="uiArea"></div></body></html>


这是官方的例子,运行效果如下


0 0
原创粉丝点击