click.stop作用
时间: 2024-05-16 21:18:43 浏览: 93
@click.stop是Vue中的一个修饰符,用于阻止事件冒泡,即阻止事件向父级元素传递。当在子组件中使用@click.stop修饰符时,点击子元素时,点击事件将只会触发子元素的事件处理函数,不会继续向父级元素传递。这样可以避免父级元素上的相同事件被触发。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [Vue:@click.stop -- 阻止事件向父级元素传递](https://blog.csdn.net/weixin_46098577/article/details/131479819)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [Vue实战(07)Vue中的@click.stop和@click.prevent](https://blog.csdn.net/qq_36396763/article/details/130521885)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文