Skip to content

Commit 9b98e5d

Browse files
committed
update(doc): form events
1 parent 98e400a commit 9b98e5d

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

document/components/docs/en-US/form.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,11 @@ CubeForm is a schema-based form generator component.
142142
type: 'upload',
143143
modelKey: 'uploadValue',
144144
label: 'Upload',
145+
events: {
146+
'file-removed': (...args) => {
147+
console.log('file removed', args)
148+
}
149+
},
145150
rules: {
146151
required: true,
147152
uploaded: (val, config) => {
@@ -415,6 +420,7 @@ CubeForm is a schema-based form generator component.
415420
| modelKey | Name of property in the `form` model | String | - | - |
416421
| label | Label of field | String | - | - |
417422
| props | This value will be the `type` or `component` props | Object | - | - |
423+
| events<sup>1.8.0+</sup> | This value will be the `type` or `component` custom events | Object | - | - |
418424
| rules | Validator rules, see <a href="#/en-US/docs/validator#cube-Props-anchor">Validator</a> | Object | - | - |
419425
| trigger<sup>1.8.0+</sup> | If set to 'blur' then will be validate this filed when blur | String | blur/change | - |
420426
| 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) | - |

document/components/docs/zh-CN/form.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,11 @@
142142
type: 'upload',
143143
modelKey: 'uploadValue',
144144
label: 'Upload',
145+
events: {
146+
'file-removed': (...args) => {
147+
console.log('file removed', args)
148+
}
149+
},
145150
rules: {
146151
required: true,
147152
uploaded: (val, config) => {
@@ -415,6 +420,7 @@
415420
| modelKey | 在表单的 `model` 数据源对象中所对应的 key 名字 | String | - | - |
416421
| label | 字段的标签值 | String | - | - |
417422
| props | type 对应的组件或者自定义组件 component 所需要的 props | Object | - | - |
423+
| events<sup>1.8.0+</sup> | type 对应的组件或者自定义组件 component 的事件回调 | Object | - | - |
418424
| rules | 字段的校验规则,参见 <a href="#/zh-CN/docs/validator#cube-Props-anchor">Validator</a> | Object | - | - |
419425
| trigger<sup>1.8.0+</sup> | 如果设置为 'blur' 那么则会在离焦后校验 | String | blur/change | - |
420426
| debounce<sup>1.8.0+</sup> | 控制校验节奏,值为时间,单位 ms。如果 trigger 设置为 blur 则此项配置不生效 | Number/Boolean | >= 0,如果设置为 true,那么时间就是 200(ms) | - |

example/pages/form/default.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,11 @@
140140
type: 'upload',
141141
modelKey: 'uploadValue',
142142
label: 'Upload',
143+
events: {
144+
'file-removed': (...args) => {
145+
console.log('file removed', args)
146+
}
147+
},
143148
rules: {
144149
required: true,
145150
uploaded: (val, config) => {

0 commit comments

Comments
 (0)