Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@alifd/form-table

Package Overview
Dependencies
Maintainers
10
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@alifd/form-table

table with form

  • 1.0.17
  • latest
  • npm
  • Socket score

Version published
Maintainers
10
Created
Source

可编辑 Table

包名:@alife/whale-form 负责人:游鹿

API

FormTable

参数说明类型默认值
field自定义 field (一般用于需要设置初始值的时候设置)Object-
actions内置行为包括增加行,删除行,复制行等

可选值:
'add', 'addInOrder', 'delete', 'copy'
cols自定义列Object-

cols 配置项

继承 Table.Column API 除此之外有一些其他配置:

参数说明类型默认值
dataKey[*常用] 作为参数提交时的name,不能重复String
fieldProps[*常用] 返回值为对象,该对象的key参考field.init方法的第二个参数optionsFunction(current, index, record) => Object-

fieldProps 配置项

参考Field 组件, init方法的第二个参数options API 有如下方法

参数说明类型默认值
initValue[*常用]组件初始值(组件第一次render的时候才会读取,后面再修改此值无效),类似defaultValueany
trigger[*常用]触发数据变化的事件名称String
rules[*常用] 校验规则 参数参考Array/Object
valueName组件值的属性名称,如 Checkbox 的是 checked,Input是 valueString
getValueFromEvent自定义从onChange事件中获取value的方式,一般不需要设置. 详细用法查看demo 自定义数据获取Function(value,...args) 参数顺序和组件是完全一致的

FormTable.Submit

继承 Button API

参数说明类型默认值
field自定义 field (一般用于需要设置初始值的时候设置)Object-
onClick点击提交后触发

签名:
Function(value: Object, errors: Object, field: class) => void
参数:
value: {Object} 数据
errors: {Object} 错误数据
field: {class} 实例
Functionfunc.noop
validate是否校验/需要校验的 name 数组Boolean/Array-

FormTable.Reset

继承 Button API

参数说明类型默认值
field自定义 field (在 Form 内不需要设置)Object-
names自定义重置的字段Array-
onClick点击提交后触发

签名:
Function() => void
Functionfunc.noop
toDefault返回默认值Boolean-

Keywords

FAQs

Package last updated on 23 Oct 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc