Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
表单基础插件
可能存在的情况
所有组件使用组件库,插件内的组件需和页面组件同步
参数 | 说明 | 类型 | 可选 | 默认值 |
---|---|---|---|---|
columns | 嵌套子项,单项控件配置 | Array | [] | - |
onChange | 组件变化触发 | fn | - | - |
onValuesChange | 数值改变时触发,同Form | fn | - | - |
onSetting | 单项设置触发,获取当前项 | fn | - | - |
onDrop | 使用拖拽 | fn | - | - |
valueMap | 自定义组件 | Object | - | - |
isEdit | 是否使用编辑模式 | Boolean | false/true | false |
…… | 其余参数同Form参数 | ... | - | - |
// 接收参数
// columns
{
label: '名称',
name: 'name',
type: 'select',
datetype: 'date', // 日期类型
required: true, // 是否必填
rules: '', // 自定义校验
readonly: false, // 是否只读
api: '',
options: [
{id: 1, label: '待提交', value: 0, readonly: false },
{id: 2, label: '待审核', value: 1, readonly: true},
], // 枚举值
hidden: false, // 是否隐藏
valueEnum: {}, // 用于修改控件的基础配置
render: '', // 自定义组件:value & onChange
col: { xs: 24, sm: 12, xl: 8, xxl: 6 }, // 栅格设置
seq: 1,
}
// valueMap用于自定义ReactNode
/*
* 请注意遵循自定义组件规范,同Form.Item
* 自定义的组件会插入Form.Item中
* Form.Item会接收Value和OnChange
*/
valueMap: {
diy: (column) => <Input placeholder="自定义render" />
}
{
...,
renderText: 'diy',
}
<ProForm columns={columns} onChange={handleChange} />
参数 | 说明 | 类型 | 可选 | 默认值 |
---|---|---|---|---|
label | 标签的文本 | String/JSX | '' | - |
*name | 字段名 | String | '' | - |
type | 控件类型,可通过valueMap拓展 | String | input/select/date/number/checkbox/radio/ | - |
datetype | 日期类型 | String | date/range/ | |
api | 接口地址 | String | - | - |
options | 枚举值 | Array | [] | - |
required | 是否必填 | Boolean | true/false | false |
readonly | 是否只读 | Boolean | true/false | false |
tooltip | 提示内容 | String | - | - |
rules | 校验内容 | String | - | - |
valueEnum | 控件配置 | Object | {} | - |
hidden | 是否隐藏 | Boolean | true/false | false |
col | 栅格 | Object | 同栅格Col组件 | { xs: 24, sm: 12, xl: 8, xxl: 6 } |
seq | 排序 | Number | ||
render(暂无) | 自定义 | Jsx | ||
renderText(暂无) | 自定义组件名 | String | '' | - |
增删改
下拉选择组件下拉数据
单选、复选、Other
FAQs
基于Antd表单Form的二次封装
We found that ck-form demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.