Convention
The design philosophy of data-driven view achieves requirements through simple configuration of data items.
Version
Currently supports element-plus version 2.7.6, and will continue to maintain compatibility.
Usage Convention
Field Naming
In form and table components, the configuration of column items is similar.
component: Configure display componentfieldProps: Configure component propertiesformItemProps: Decorator component propertiesfield: Component field namelabel: Titleon + event: Component event configurationslot: Slotrender:h functionorrender functionhide: Show/hide display configuration (based onv-if)show: Show/hide display configuration (based onv-show)
Built-in Components
For the column items in forms or tables, the component field supports local components (controlled components), global components (controlled components), and built-in components.
Built-in components include: input, select, radio, checkbox, which will be processed internally in form and table components as z-input, z-select, etc.
Usage example:
import { ElInput } from 'element-plus'
const columns = [
{
component: ElInput
},
{
component: 'el-input'
},
{
component: 'input'
},
]Slots
For components or column items that support fields like label or title, you can pass strings with Slot suffix like labelSlot, titleSlot, which will be processed as slots internally by the component.
All customizable properties or configurations support h function, slots, and render function.
Default Configuration
Components like ZForm, ZFilterForm, ZCrud will default configure properties like placeholder, clearable, filterable, and support customization.
ZFilterForm responsive default configuration is { xl: 6, lg: 8, md: 8, sm: 12, xs: 24 }