Fundamental style

介绍一个UI库 - Fundamental style

今天给大家介绍一个由SAP开发并开源的UI库 -Fundamental style。它符合SAP最新的Fiori 3设计。

主页: https://sap.github.io/fundamental-styles/

支持React, Vue,Angular。

大致浏览了一下常用的组件,还是蛮漂亮的。

测试小Demo

  1. 通过API获取后端银行数据
    简化起见,我把获取的数据保存为了本地json。大致像这样:
{
    "BankCountry": "US",
        "BankInternalID": "444444",
        "BankName": "Citibank NY",
        "SWIFTCode": "CHASUS33XXX",
        "BankGroup": "",
        "BankNumber": "",
        "Region": "NY",
        "StreetName": "Citi. 388 Greenwich Street",
        "CityName": "New York",
        "Branch": ""
}
  1. 前端通过列表展示

通过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>
    );
}
  1. 本地测试运行
npm run

运行结果如下:
在这里插入图片描述

  1. 部署到SAP Cloud Foundry
cf push

可以在这里访问demo:

https://test08-funny-porcupine.cfapps.eu10.hana.ondemand.com/

小结

Fundarmental可以让大家在项目中很方便的保留自己熟悉的框架,依然通过Fiori的用户体验。推荐可以关注一下。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值