提交 7f60fa96 编写于 作者: D dolymood

update(doc): form events

上级 460a181b
...@@ -142,6 +142,11 @@ CubeForm is a schema-based form generator component. ...@@ -142,6 +142,11 @@ CubeForm is a schema-based form generator component.
type: 'upload', type: 'upload',
modelKey: 'uploadValue', modelKey: 'uploadValue',
label: 'Upload', label: 'Upload',
events: {
'file-removed': (...args) => {
console.log('file removed', args)
}
},
rules: { rules: {
required: true, required: true,
uploaded: (val, config) => { uploaded: (val, config) => {
...@@ -415,6 +420,7 @@ CubeForm is a schema-based form generator component. ...@@ -415,6 +420,7 @@ CubeForm is a schema-based form generator component.
| modelKey | Name of property in the `form` model | String | - | - | | modelKey | Name of property in the `form` model | String | - | - |
| label | Label of field | String | - | - | | label | Label of field | String | - | - |
| props | This value will be the `type` or `component` props | Object | - | - | | props | This value will be the `type` or `component` props | Object | - | - |
| events<sup>1.8.0+</sup> | This value will be the `type` or `component` custom events | Object | - | - |
| rules | Validator rules, see <a href="#/en-US/docs/validator#cube-Props-anchor">Validator</a> | Object | - | - | | rules | Validator rules, see <a href="#/en-US/docs/validator#cube-Props-anchor">Validator</a> | Object | - | - |
| trigger<sup>1.8.0+</sup> | If set to 'blur' then will be validate this filed when blur | String | blur/change | - | | trigger<sup>1.8.0+</sup> | If set to 'blur' then will be validate this filed when blur | String | blur/change | - |
| debounce<sup>1.8.0+</sup> | Debounce validating time(ms). If `trigger` is 'blur' then the debounce will be ignored | Number/Boolean | >= 0, if set to true the time will be 200(ms) | - | | debounce<sup>1.8.0+</sup> | Debounce validating time(ms). If `trigger` is 'blur' then the debounce will be ignored | Number/Boolean | >= 0, if set to true the time will be 200(ms) | - |
......
...@@ -142,6 +142,11 @@ ...@@ -142,6 +142,11 @@
type: 'upload', type: 'upload',
modelKey: 'uploadValue', modelKey: 'uploadValue',
label: 'Upload', label: 'Upload',
events: {
'file-removed': (...args) => {
console.log('file removed', args)
}
},
rules: { rules: {
required: true, required: true,
uploaded: (val, config) => { uploaded: (val, config) => {
...@@ -415,6 +420,7 @@ ...@@ -415,6 +420,7 @@
| modelKey | 在表单的 `model` 数据源对象中所对应的 key 名字 | String | - | - | | modelKey | 在表单的 `model` 数据源对象中所对应的 key 名字 | String | - | - |
| label | 字段的标签值 | String | - | - | | label | 字段的标签值 | String | - | - |
| props | type 对应的组件或者自定义组件 component 所需要的 props | Object | - | - | | props | type 对应的组件或者自定义组件 component 所需要的 props | Object | - | - |
| events<sup>1.8.0+</sup> | type 对应的组件或者自定义组件 component 的事件回调 | Object | - | - |
| rules | 字段的校验规则,参见 <a href="#/zh-CN/docs/validator#cube-Props-anchor">Validator</a> | Object | - | - | | rules | 字段的校验规则,参见 <a href="#/zh-CN/docs/validator#cube-Props-anchor">Validator</a> | Object | - | - |
| trigger<sup>1.8.0+</sup> | 如果设置为 'blur' 那么则会在离焦后校验 | String | blur/change | - | | trigger<sup>1.8.0+</sup> | 如果设置为 'blur' 那么则会在离焦后校验 | String | blur/change | - |
| debounce<sup>1.8.0+</sup> | 控制校验节奏,值为时间,单位 ms。如果 trigger 设置为 blur 则此项配置不生效 | Number/Boolean | >= 0,如果设置为 true,那么时间就是 200(ms) | - | | debounce<sup>1.8.0+</sup> | 控制校验节奏,值为时间,单位 ms。如果 trigger 设置为 blur 则此项配置不生效 | Number/Boolean | >= 0,如果设置为 true,那么时间就是 200(ms) | - |
......
...@@ -140,6 +140,11 @@ ...@@ -140,6 +140,11 @@
type: 'upload', type: 'upload',
modelKey: 'uploadValue', modelKey: 'uploadValue',
label: 'Upload', label: 'Upload',
events: {
'file-removed': (...args) => {
console.log('file removed', args)
}
},
rules: { rules: {
required: true, required: true,
uploaded: (val, config) => { uploaded: (val, config) => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册