Skip to content

Trigger Component Events

Manually trigger component events (such as change, blur) by calling the $emit method on specific components through the form API. This allows you to directly control and interact with form component events.

Note

When using api.el('xxx').$emit to manually trigger component events, keep the following points in mind to avoid compatibility issues:

  1. Event Parameter Format: Ensure that the event parameters passed match the parameter format of the component's native event handlers exactly, including parameter types, order, and count.

  2. Parameter Value Types: Different components may have different requirements for parameter types of the same event (e.g., a change event may pass strings, numbers, or objects). Refer to the specific component documentation to determine the correct parameter type.

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