Skip to content

Commit 0643650

Browse files
author
luzhipeng
committed
fix: 代码描述错误
1 parent 9df04bc commit 0643650

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

docs/topics/browser/event.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -167,14 +167,18 @@ function capture(e, currentElement) {
167167
if (currentElement.listners[e.type] !== void 0) {
168168
currentElement.listners[e.type].forEach(fn => fn(e))
169169
}
170+
171+
170172
// pass down
171173
if (currentElement !== e.target) {
172-
currentElement.children.forEach(child => capture(e, child))
174+
// getActiveChild用于获取当前事件传播链路上的子节点
175+
capture(e, getActiveChild(currentElement, e))
173176
} else {
174177
bubble(e, currentElement)
175178
}
176179
}
177180

181+
// 这个Event对象由引擎创建
178182
capture(new Event(), document.querySelector('html'))
179183

180184
```

0 commit comments

Comments
 (0)