Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
chart-render
Advanced tools
tnpm i -S @ali/one-table-render
import React from 'react';
import TableRender from '@ali/one-table-render';
import * as api from './mock';
const searchSchema = {
"propsSchema": {
"type": "object",
"properties": {
"position": {
"title": "职级",
"type": "string",
"enum": ["p5", "p6", "p7", "p8", "p9"],
"ui:width": "20%"
},
"name": {
"title": "姓名",
"type": "string",
"ui:width": "20%"
},
"address": {
"title": "地址",
"type": "string",
"ui:width": "60%"
},
"tags": {
"title": "标签",
"description": "下拉多选",
"type": "array",
"items": {
"type": "string"
},
"enum": ["a", "b", "c", "d"],
"enumNames": ["在杭", "单身", "95后", "土豪"],
"ui:widget": "multiSelect",
"ui:width": "40%"
},
"dateRange": {
"title": "日期范围",
"type": "range",
"format": "dateTime",
"ui:options": {
"placeholder": ["开始时间", "结束时间"]
},
"ui:width": "60%"
}
}
},
"displayType": "row",
"showDescIcon": true,
"labelWidth": 80
}
const columns = [
{
title: '名字',
key: 'name',
type: 'link',
},
{
title: '年龄',
key: 'age',
},
{
title: '地址',
key: 'address',
},
{
title: '标签',
key: 'tags',
type: 'tags',
},
];
const schema = {
// 搜索的配置
searchConfig: {
schema: searchSchema, // search的协议,使用FormRender的标准schema
initialValue: {},
tab: 0, // 选中的tab,如果没有多个不用填
api: [
{ text: '全部', action: '$api.getAllData' },
{ text: '我的', action: '$api.getData' },
], // api: { text: '场次规划列表', action: '$api.getData' } 当只有一个值的时候
},
// 除了操作项以外的每行配置
columns,
// 每行的操作项的配置
operations: [
{ text: '配置', action: '$api.openSettings' },
{ text: '删除', action: '$api.deleteRow' },
],
...
// 在此层可使用所有antd文档支持的props
};
const Demo = () => {
return (
<TableRender
schema={schema}
api={api} // 所有的使用到的操作函数和请求函数,只要挂在api下
widgets={{ link: text => <a>{text}</a> }} // 有默认的,也可以在此自定义扩展
/>
);
};
export default Demo;
目前支持的type
有:tags,link
FAQs
C
The npm package chart-render receives a total of 3 weekly downloads. As such, chart-render popularity was classified as not popular.
We found that chart-render demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.