Ultra Form
Advanced forms for quickly building form UIs. Using pro-form requires the use of defineForm Functions.
Advanced forms are based on object-oriented functional programming concepts. The form data is abstracted as a JavaScript object, which can be manipulated and encapsulated for better reusability and maintainability.
UltraForm is a downward-compatible wrapper based on Naive Form, fully compatible with Naive features, and includes all data entry components. It also adds some preset behaviors and layouts, and provides a common API.
Form Props
Name | Type | Default | Description |
---|---|---|---|
is | UltraFormInstance | - | Instance of the component |
grid | boolean | true | Enable grid layout |
cols | `number | ResponsiveDescription` | 24 |
x-gap | `number | ResponsiveDescription` | 0 |
y-gap | `number | ResponsiveDescription` | 0 |
Form Methods
Name | Type | Description |
---|---|---|
validate | (paths?: string[]) => Promise<void> | Validate form items, filter by paths |
resetValidate | (paths?: string[]) => void | Reset validation, filter by paths |
resetFields | (paths?: string[]) => void | Reset form data to initial values, filter by paths |
Field Methods
Name | Type | Description |
---|---|---|
config | (config) => Field | Attach and return a new config |
preventDefault | () => Field | Clear label and rules |
preventRequired | () => Field | Remove required from rules |
preventAutofill | () => Field | Prevent browser autofill |
clone | () => Field | Shallow clone field |
cloneDeep | () => Field | Deep clone field |
Field Types
Name | Description |
---|---|
date-picker | Date picker |
auto-complete | Auto complete |
cascader | Cascader |
input | Input |
input-number | Input number |
rate | Rate |
time-picker | Time picker |
mention | Mention |
select | Select |
switch | Switch |
slider | Slider |
radio | Radio |
checkbox | Checkbox |
textarea | Textarea |
Slots
Name | Type | Description |
---|---|---|
toolbars | () | Toolbar content, enable toolbar mode by default |