VS CODE环境安装和hello world

SAP UI5 demo walkthrough tutorial step1 hello word

首先要安装nodejs,然后才能执行下面的操作
nodejs
vscode

  1. 安装ui5
bash 复制代码
npm install --global @ui5/cli

报错解决:

idealTree:npm: sill idealTree buildDeps

这个信息说明npm正在构建,如一直停留在这个界面,检查下网络,例如是否连接的是内网等

  1. 本地创建你的项目的文件夹APP1 HELLO WORD,VSCODE打开进入APP1 HELLO WORD文件夹后,执行init
bash 复制代码
npm init --yes
  1. 在APP1 HELLO WORD中创建webapp文件夹
  2. 在APP1 HELLO WORD中执行,生成ui5.yaml
bash 复制代码
ui5 init

报错解决:

  • FullyQualifiedErrorId : CommandNotFoundException
    确认UI5 Tooling是否已经安装成功(ui5 --version)
  • FullyQualifiedErrorId : UnauthorizedAccess
    以管理员身份运行powershell,执行Set-ExecutionPolicy RemoteSigned命令,然后输入A
  1. 在webapp里创建manifest.json文件
javascript 复制代码
{
    "sap.app": {
        "id": "sap.ui.demo.walkthrough"
    }
}
  1. 在APP1 HELLO WORD,VSCODE文件夹里执行,会更新ui5.yaml
bash 复制代码
ui5 use SAPUI5@latest
  1. 在webapp文件夹下创建index.html文件
html 复制代码
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>SAPUI5 Walkthrogh</title>
    </head>
    <body>
        <dir>Hello Word</dir>
    </body>
</html>
  1. 启动server,在APP1 HELLO WORD文件夹下执行
bash 复制代码
ui5 serve
  1. 在浏览器里值执行:http://localhost:8080/index.html
相关推荐
坐忘3GQ1 个月前
88.SAPUI5 Model Binding的问题-在view更改数据,model却不变
sap ui5·sap.ui.model·jsonmodel·bindingmode·oneway·twoway