1. 程式人生 > 其它 >SAP OPEN UI5 Step1 環境安裝和hello world

SAP OPEN UI5 Step1 環境安裝和hello world

轉載請聯絡vx:xiaoshitou5854

1,安裝ui5

npm install --global @ui5/cli

2,建立你的專案的資料夾app1,進入app1資料夾後,執行init

npm init --yes

3,在app1裡建立webapp資料夾

4,在app1資料夾裡執行,生成ui5.yaml

ui5 init

5,在webapp裡建立manifest.json檔案,檔案的內容從這裡,copy出來,修改下面的部分。

如果link失效,可以在搜尋【open ui5 createing a descriptor file for existing apps】,也能找到link

 "handleValidation": false,
 "extends": {
            "component" : "<extendedComponentId>",
			"minVersion": "<minComp1Version>",
			"extensions": {}
        },
 "contentDensities": {
            "compact": false,
            "cozy": false
        }

5,在app1資料夾裡執行,會更新ui5.yaml

ui5 use SAPUI5@latest

6,在webapp資料夾下建立index.html檔案

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>SAPUI5 Walkthrogh</title>
    </head>
    <body>
        <dir>Hello Word</dir>
    </body>
</html>

7,啟動server,在app1資料夾下執行

$ ui5 serve
Server started
URL: http://localhost:8080

8,在瀏覽器裡值執行:http://localhost:8080/index.html

可以看到Hello Word,表示了出來。

官方教程:https://openui5.hana.ondemand.com/topic/3da5f4be63264db99f2e5b04c5e853db

本人微信:xiaoshitou5854