Object Component
The subForm component (also known as object component) allows nesting sub-forms within forms, making it easier to organize and manage complex form structures. It's ideal for forms that need to be processed in blocks, such as user details, addresses, etc.
Note
Component linkage within sub-forms is recommended to be implemented using Component Linkage or Computing Component Rules.
When operating components within sub-forms, use the sub-form's API. In the parent form, access the sub-form's API through the api.getSubForm method.
Example
Listening to Component Events in Sub-form
This example shows how to listen to component events in sub-forms.
Configuration
props
| Parameter Name | Description | Type | Default Value |
|---|---|---|---|
| rule (Required) | Sub-form generation rules | Rule[] | - |
| options | Sub-form option configuration | Object | {submitBtn: false,resetBtn: false} |
| modelValue (v-model) | Sub-form value | Object | - |
| disabled | Whether disabled | Boolean | false |
events
| Event Name | Description | Return Value |
|---|---|---|
| change | Triggered after value changes | - |
| itemMounted | Triggered after sub-form initialization is complete | - |
[field-eventName] | Listen to sub-form emit events, format is sub-form field name concatenated with event name | - |


