Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

146.[js]如何理解事件委托 #146

Open
webVueBlog opened this issue Mar 31, 2020 · 1 comment
Open

146.[js]如何理解事件委托 #146

webVueBlog opened this issue Mar 31, 2020 · 1 comment
Labels
JavaScript JavaScript

Comments

@webVueBlog
Copy link
Member

[软技能]

@webVueBlog webVueBlog added the JavaScript JavaScript label Mar 31, 2020
@webVueBlog
Copy link
Member Author

这是一种让父元素上的事件监听器也影响子元素的技巧。通常,事件传播(捕获和冒泡)允许我们实现事件委托。冒泡意味着当触发子元素(目标)时,也可以逐层触发该子元素的父元素,直到它碰到DOM绑定的原始监听器(当前目标)。捕获属性将事件阶段转换为捕获阶段,让事件下移到元素; 因此,触发方向与冒泡阶段相反。捕获的默认值为false。

@webVueBlog webVueBlog changed the title 146.[软技能]如何理解事件委托 146.[js]如何理解事件委托 Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JavaScript JavaScript
Projects
None yet
Development

No branches or pull requests

1 participant