Ele.me join the realization of shopping cart button

problem description

The

circle represents the click area, the square represents the area of the child element, and the parent element is the size of the picture. When the finger clicks on the child element (plus button), it also clicks on the parent element (white background), as shown in the figure. As long as the click area contains a child element, it triggers the event of the child element, but not the event of the parent element.
when I click on the circle area, it is easy to click on the white background to trigger other events, rather than the desired increase in the number of events. How can I expand the click area of the button?

Jul.11,2022

prevent event bubbles if you are using vue @ click.stop= "" native, e.stop ()


add event prevention event you can interrupt the event flow by calling event.prepagation (). Subsequent phases will not be called see this article

Menu