使用说明
capture: true:在事件到达目标前的捕获阶段执行。once: true:第一次执行后自动注销。passive: true:声明 handler 不会取消平台默认行为;此时preventDefault()不生效。
消费 wheel、触控板或浏览器默认行为的监听器不能声明为 passive。stopPropagation() 与 stopImmediatePropagation() 属于事件对象,不属于 listener options。
Runtime API / Interface
配置统一事件监听器的捕获阶段、单次执行和被动默认行为语义。
使用说明
capture: true:在事件到达目标前的捕获阶段执行。once: true:第一次执行后自动注销。passive: true:声明 handler 不会取消平台默认行为;此时 preventDefault() 不生效。消费 wheel、触控板或浏览器默认行为的监听器不能声明为 passive。stopPropagation() 与 stopImmediatePropagation() 属于事件对象,不属于 listener options。