element UI event callback function passing parameters, passing default parameters and custom parameters

Problem: When using element UI components, the event callback has default parameters, and I want to add custom attributes.

image.png

solution

The default parameter of the change event is the data of the v-model bound by select as the parameter of the callback function.
If you want to add a custom parameter, change('custom') write directly, then the custom parameter will override the default parameter (This default parameter will also be the parameter we need), so change('custom', $event) is needed

This is also a problem that is often encountered but also ignored. Record it here. A good memory is not as good as a bad pen.

Guess you like

Origin blog.csdn.net/weixin_45634433/article/details/118975348