Skip to content

Viewing Component Functionality ​

Due to dependency on UI frameworks, component configuration items in the documentation may not be updated in real-time. The following example uses element-plus to show how to view the actual available configuration items of built-in components.

Example: View the Select component's complete functionality list and usage examples

1. Find the Component's UI Official Documentation ​

Use the links in the documentation

progress1.png

Or find the component directly on the UI official website

progress2.png

2. View Component Configuration (props) ​

progress3.png

Configure props in rules

js
const rule = {
    type: 'select', 
    props: {
        multiple: true
   }
}

3. View Component Events ​

progress4.png

Configure events in rules

js
const rule = {
    type: 'select', 
    on: {
        change() {
            // todo
        }
   }
}

4. View Component Slots ​

progress5.png

Configure slots in rules

js
const rule = {
    type: 'select', 
    children: [
        {
            type: 'span',
            slot: 'header',
            children: ['Selection List']
        },
        {
            type: 'span',
            slot: 'empty',
            children: ['Content is empty']
        },
    ]
}

5. View Component Methods ​

progress6.png

Call component methods through api

js
const rule = {
    type: 'select',
    field: 'user_type',
    name: 'user_type_select',
}
// After component is rendered, get the component instance through the api
api.el('user_type').focus();
// Can also be called by name
api.el('user_type_select').focus();

FormCreate is an open-source project released under the MIT License. Free for personal and commercial use.