SoFunction
Updated on 2025-04-04

Methods to prevent click events from bubbling in vue and prevent another event from being triggered

Use vue to prevent click events from bubbled in child elements, it is very simple, use stop

<div @click="test1()"> 
   <span @="test2()">Button1</span> 
   <span>Button2</span> 
</div> 

In this way, clicking button 1 in the div will not trigger the div binding time test1() method.

The above vue article to prevent click events from bubbling and prevent another event from triggering is the entire content I share with you. I hope you can give you a reference and I hope you can support me more.