@xrenders/data-view
v1.0.0-alpha.9
Published
<div style="display:flex;align-items:center;margin-bottom:24px"> <img src="https://img.alicdn.com/tfs/TB17UtINiLaK1RjSZFxXXamPFXa-606-643.png" alt="logo" width="48px"/> <span style="font-size:30px;font-weight:600;display:inline-block;margin-left:12px"
Downloads
3
Maintainers
Readme
中后台详情页解决方案,通过 schema 协议渲染页面
安装
npm i @xrenders/data-view --save
使用方式
函数组件
/**
* transform: true
* defaultShowCode: true
*/
import React from 'react';
import DataView from '@xrenders/data-view';
const data = {
"creator": "清风徐来",
"relevanceCode": "421421",
"desc": "浙江省杭州市工专路",
"create-time": "2019-10-10",
"effective-date": "2019-10-10 ~ 2020-10-31",
"safety": {
"name": "Test demo 001",
"app": "中后台详情页",
"mode": "代码包",
"yum": "244444390482344744484889",
"fore": "23"
},
}
const schema = [
{
"widget": "FDescriptions",
"column": 3,
"items": [
{
"label": "创建人",
"dataKey": "creator"
},
{
"label": "关联单据",
"dataKey": "relevanceCode"
},
{
"label": "单据备注",
"dataKey": "desc"
},
{
"label": "创建时间",
"dataKey": "create-time"
},
{
"label": "生效日期",
"dataKey": "effective-date"
}
]
}
]
export default () => {
return (
<DataView schema={schema} data={data} />
);
}