vue教程-事件修饰符-阻止事件冒泡 .stop 作者:马育民 • 2022-01-16 16:05 • 阅读:10071 上接:[vue教程-事件修饰符介绍](https://www.malaoshi.top/show_1IX2bPz7jE94.html "vue教程-事件修饰符介绍") # 提出问题 下面代码中,在 `div` 里面有 `button` 按钮,而且都添加了 点击事件,触发事件时,先执行 `button` 按钮的事件,然后执行 `div` 的事件 **实际上:**我们只想执行 `button` 按钮的事件 ``` ``` ### 解决 在 按钮事件修改为 `@click.stop` ,可阻止事件冒泡,不执行 外部 `div` 的事件 ``` ``` 原文出处:http://malaoshi.top/show_1IX2bTHzcm3t.html