Fiori WalkThrough学习-Step01.环境搭建

发布时间 2023-12-08 08:19:25作者: 阿胖的阿多

1.软件下载:

node.js:https://nodejs.org/en

VSCode:https://code.visualstudio.com/

2.安装Ui5

终端命令:

npm install --global @ui5/cli

3.创建项目文件夹,在项目文件夹下执行初始化命令

我的项目文件夹:D:\FioriProject-20231207

在VSCode中也可使用终端

在项目文件夹下执行终端命令:

npm init --yes

 4.在项目文件夹下创建webapp文件夹

 5.在项目文件夹里执行,生成ui5.yaml

 终端命令:

ui5 init

 有可能报错:在此系统上禁止运行脚本

解决方案:管理员身份在PowerShell上执行:Set-ExecutionPolicy RemoteSigned,然后会有提示框,输入A回车

6.在webapp里创建manifest.json文件

{
    "sap.app": {
        "id":"sap.ui.demo.walkthrough"
    }
}

7.在项目文件夹里执行终端代码,更新ui5.yaml

ui5 use SAPUI5@latest

 8.在webapp文件夹下创建index.html文件

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <dir>Hello Word</dir>
</body>
</html>

9.在项目文件夹下执行终端命令,启动Server

ui5 serve

 10.进入URL:http://localhost:8080/index.html 查看效果