Difference between WeChat applet targeter and currentTarget attributes

target is the source component that triggers the event , and the currentTarget property is the component that the current event is bound to . Examples are as follows:

 When the inner button is clicked, the click event spreads outward in a bubbling manner , and also triggers the tap event handler function of the outer view. At this time, for the outer view:

①e.target points to the source component that triggers the event, therefore, e.target is the internal component button

②e.currentTarget points to the component that is currently triggering the event, therefore, e.currentTarget is the current view component

Guess you like

Origin blog.csdn.net/weixin_50123771/article/details/129002069
Recommended