admin管理员组文章数量:1613368
介绍一个UI库 - Fundamental style
今天给大家介绍一个由SAP开发并开源的UI库 -Fundamental style。它符合SAP最新的Fiori 3设计。
主页: https://sap.github.io/fundamental-styles/
支持React, Vue,Angular。
大致浏览了一下常用的组件,还是蛮漂亮的。
测试小Demo
- 通过API获取后端银行数据
简化起见,我把获取的数据保存为了本地json。大致像这样:
{
"BankCountry": "US",
"BankInternalID": "444444",
"BankName": "Citibank NY",
"SWIFTCode": "CHASUS33XXX",
"BankGroup": "",
"BankNumber": "",
"Region": "NY",
"StreetName": "Citi. 388 Greenwich Street",
"CityName": "New York",
"Branch": ""
}
- 前端通过列表展示
通过React构建了两个组件:导航条和内容。
内容Banks.js:
import React from 'react';
import data from './response_banks';
export default function Banks() {
return (
<table class="fd-table">
<thead class="fd-table__header">
<tr class="fd-table__row">
<th class="fd-table__cell" scope="col">Bank Name</th>
<th class="fd-table__cell" scope="col">Bank Country</th>
<th class="fd-table__cell" scope="col">Region</th>
<th class="fd-table__cell" scope="col">Street Name</th>
</tr>
</thead>
<tbody class="fd-table__body">
{
data.d.results.map(
b =>
<tr class="fd-table__row">
<td class="fd-table__cell">{b.BankName}</td>
<td class="fd-table__cell">{b.BankCountry}</td>
<td class="fd-table__cell">{b.Region}</td>
<td class="fd-table__cell">{b.StreetName}</td>
</tr>
)
}
</tbody>
</table>
);
}
- 本地测试运行
npm run
运行结果如下:
- 部署到SAP Cloud Foundry
cf push
可以在这里访问demo:
https://test08-funny-porcupine.cfapps.eu10.hana.ondemand/
小结
Fundarmental可以让大家在项目中很方便的保留自己熟悉的框架,依然通过Fiori的用户体验。推荐可以关注一下。
本文标签: fundamentalstyle
版权声明:本文标题:Fundamental style 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/xitong/1728642700a1167320.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论