中国教育热线_中国教育资讯门户网站
您当前的位置 : 中国教育热线  >  游戏
使用SAP UI5 Web Components开发React应用
2020-03-31 07:12:18 来源:互联网 阅读:-

(1) 命令行 npx create-react-app my-app --template @ui5/cra-template-webcomponents-react


创建名为my-app的react应用,并安装对应的依赖。


成功执行后,会看到Success! Created my-app at XXXX的提示信息:

使用SAP UI5 Web Components开发React应用


使用SAP UI5 Web Components开发React应用

进入my-app项目的src文件夹里,新建MyApp.jsx:


使用SAP UI5 Web Components开发React应用

import React from "react";


export function MyApp() {

return

My root component
;

}


在App.js里导入这个Component:

使用SAP UI5 Web Components开发React应用

npm start

使用SAP UI5 Web Components开发React应用

浏览器里输入localhost:3000, 就能看到这个最简单的React应用了:

使用SAP UI5 Web Components开发React应用

推荐阅读:2019笔记本电脑性价比排行榜

频道推荐