在MyApp.jsx里引入UI5针对React框架的开发的Card web Component:

代码如下:
import React from 'react'
import { Card } from "@ui5/webcomponents-react";
export function MyApp() {
return (
<div>
<Card heading="Card"></Card>
</div>
);
}然后和正常的React应用一样,在App.js里引入我们自定义的Component:

代码如下:
import React from "react";
import { MyApp } from "./MyApp";
import { ThemeProvider } from "@ui5/webcomponents-react/lib/ThemeProvider";
function App() {
return (
<ThemeProvider withToastContainer>
<MyApp />
</ThemeProvider>
);
}
export default App;
这个Card Component是SAP发布的针对React框架的标准组件。
可以在这个链接里看到明细:

开发完毕后,npm start可以看到效果了:

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/24475491/viewspace-2675812/ ,如需转载,请注明出处,否则将追究法律责任。