Home>Article>Web Front-end> Quickly understand the functional design of UI components
Components can significantly reduce the development workload, improve the maintainability of the project, and reduce duplicate code. This article mainly explains what functions the components need to have. You can learn about it. I hope it can help you.
The main function refers to what this component is used for. For example, the goal of the date selection component is to select a date, and the goal of the drop-down selection component is to display options for the user. Select Wait. This is the first part to consider and is the basis of the component.
The granular control function of the main function refers to the function of detailed control of the component function, which can be divided into
1. Function switches, such as date The selection component has the function of selecting time, and can provide an API to control whether to start the time selection function, the date selectable range, etc.;
2. Behavior control function, such as controlling whether the pop-up box is displayed
3. Content control Functions, such as the custom column function of the table, the unit custom rendering function of the time selector, and the footer customization function of the pop-up box.
4. Structure control components, such as drop-down boxes that can customize containers.
5. Style control function. In most cases, users can easily modify the style of components, but in some cases
After the basic function of a component is written, there needs to be appropriate feedback to tell the program what happened. Only in this way can the program respond accordingly based on the feedback from the component. Diverse interactions to meet more scenarios. Common feedback includes: numerous events in browser elements.
Related tutorials:UI video tutorial
The above is the detailed content of Quickly understand the functional design of UI components. For more information, please follow other related articles on the PHP Chinese website!