DynamicInput
Add/remove/edit for array fields; each row reuses the oas-input component, supporting both controlled and uncontrolled modes.
Basic Usage
Add/remove list
model-value is a JSON array attribute (also assignable via property); each row has an input + remove button, with an "添加" button at the end.
Default Value
default-value
New rows start with default-value as their initial value.
min / max Boundaries
min=2 fills up rows
Under min, rows are auto-filled; when min is reached, remove buttons are disabled.
max=3 disables adding
When max is reached, the "添加" button is disabled; an over-long model-value is truncated automatically.
Disabled
disabled
Events
Change events
Listen to oas-change (detail: { value: string[] }):
API
Attributes
| Attribute | Description | Type | Default |
|---|---|---|---|
default-value | Default value for new rows | string | — |
disabled | Disabled (row inputs + buttons) | boolean | — |
max | Maximum rows; truncates when over | string | — |
min | Minimum rows; auto-fills when below | string | 0 |
model-value | String array (property or JSON) | string[] | [] |
Events
| Event | Description |
|---|---|
oas-change | Dispatched after add/remove/edit, detail: { value } |
Controlled: listen to oas-change and set the modelValue property (or the model-value attribute) to write back.