vscode 配置UI5环境
SAP UI5环境配置
首先要安装nodejs,然后才能执行下面的操作
nodejs:https://nodejs.org/en/
vscode:https://code.visualstudio.com/
1,安装ui5
npm install --global @ui5/cli
2,创建你的项目的文件夹app1,进入app1文件夹后,执行init
npm init --yes
3,在app1里创建webapp文件夹
4,在app1文件夹里执行,生成ui5.yaml
ui5 init
注意:在windows下的vscode的命令行下执行此命令会出下面的错误:
ui5 : C:\Users\aaa\App Data\Roaming\npm\ui5.ps1 「about_Execution_Polic
ies」(https://go.microsoft.com/fwlink/?LinkID=135170)
+ ui5 init
+ ~~~
+ FullyQualifiedErrorId : UnauthorizedAccess
解决办法:管理员身份运行powershell,执行Set-ExecutionPolicy RemoteSigned命令,然后有个提示,然后输入A,就可以了。
参考:https://kaede.jp/2017/01/23005300/
5,在webapp里创建manifest.json文件
{
"sap.app": {
"id": "sap.ui.demo.walkthrough"
}
}
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
posted on 2022-06-17 11:47 SmartTony_07 阅读(1008) 评论(0) 收藏 举报
浙公网安备 33010602011771号