{"id":109414,"date":"2026-09-24T03:32:56","date_gmt":"2026-09-23T19:32:56","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/109414.html"},"modified":"2026-09-24T03:32:56","modified_gmt":"2026-09-23T19:32:56","slug":"%e6%bb%9a%e5%8a%a8%e6%80%a7%e8%83%bd%e7%bb%88%e6%9e%81%e4%bc%98%e5%8c%96%ef%bc%9apassive-event-listeners-%e4%b8%8e%e8%99%9a%e6%8b%9f%e6%bb%9a%e5%8a%a8","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/109414.html","title":{"rendered":"\u6eda\u52a8\u6027\u80fd\u7ec8\u6781\u4f18\u5316\uff1aPassive Event Listeners \u4e0e\u865a\u62df\u6eda\u52a8"},"content":{"rendered":"<h2>\u6eda\u52a8\u6027\u80fd\u7ec8\u6781\u4f18\u5316&#xff1a;Passive Event Listeners \u4e0e\u865a\u62df\u6eda\u52a8<\/h2>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260923193255-6ab4296748952.webp\" alt=\"\u5c01\u9762\u4fe1\u606f\u56fe\" \/><\/p>\n<p>\u5728\u79fb\u52a8\u7aef H5 \u5546\u57ce\u3001\u793e\u4ea4\u5a92\u4f53\u4fe1\u606f\u6d41&#xff08;Feed \u6d41&#xff09;\u3001\u957f\u8868\u683c\u4ee5\u53ca\u590d\u6742\u804a\u5929\u9762\u677f\u7b49\u9ad8\u9891\u4ea4\u4e92\u573a\u666f\u4e2d&#xff0c;\u201c\u6eda\u52a8\u6d41\u7545\u5ea6&#xff08;Scrolling Smoothness&#xff09;\u201d \u662f\u51b3\u5b9a\u7528\u6237\u5bf9\u4ea7\u54c1\u7b2c\u4e00\u5370\u8c61\u7684\u201c\u751f\u6b7b\u7ebf\u201d\u3002<\/p>\n<p>\u8bb8\u591a\u524d\u7aef\u5f00\u53d1\u8005\u7ecf\u5e38\u9047\u5230\u8fd9\u6837\u4e00\u79cd\u8be1\u5f02\u7684\u5361\u987f\u73b0\u8c61&#xff1a;<\/p>\n<ul>\n<li>\u9875\u9762\u660e\u660e\u6ca1\u51e0\u884c\u4ee3\u7801&#xff0c;\u4f46\u624b\u6307\u5728\u624b\u673a\u5c4f\u5e55\u4e0a\u8f7b\u8f7b\u6ed1\u52a8\u4e00\u4e0b&#xff0c;\u9875\u9762\u603b\u8981\u8fdf\u6ede 100ms ~ 200ms \u4e4b\u540e\u624d\u6162\u541e\u541e\u5730\u5f00\u59cb\u6eda\u52a8&#xff1b;<\/li>\n<li>\u5feb\u901f\u8fde\u7eed\u6ed1\u52a8\u5217\u8868\u65f6&#xff0c;\u63a7\u5236\u53f0\u75af\u72c2\u62a5\u9519&#xff1a;[Violation] Added non-passive event listener to a scroll-blocking &#039;touchstart&#039; event. Consider marking event handler as &#039;passive&#039; to make the page more responsive.&#xff1b;<\/li>\n<li>\u5f53\u5217\u8868\u6570\u636e\u52a0\u8f7d\u5230 2,000 \u6761\u4ee5\u4e0a\u65f6&#xff0c;\u9875\u9762\u6ed1\u52a8\u77ac\u95f4\u51fa\u73b0\u6076\u52a3\u7684\u201c\u753b\u9762\u6495\u88c2\u4e0e\u6389\u5e27\u6210 PPT\u201d\u3002<\/li>\n<\/ul>\n<p>\u5bfc\u81f4\u8fd9\u79cd\u5361\u987f\u7684\u6839\u672c\u539f\u56e0&#xff0c;\u5728\u4e8e\u5bf9**\u201c\u6d4f\u89c8\u5668\u7684\u5408\u6210\u5668\u7ebf\u7a0b\u6eda\u52a8\u9501&#xff08;Compositor Thread Scrolling Lock&#xff09;\u201d\u4ee5\u53ca\u201cDOM \u6811\u7269\u7406\u627f\u8f7d\u6781\u9650\u201d**\u7684\u8ba4\u77e5\u7f3a\u5931\u3002<\/p>\n<p>\u5b9e\u73b0\u6eda\u52a8\u6027\u80fd\u7684\u7ec8\u6781\u4f18\u5316&#xff0c;\u5fc5\u987b\u7531\u5185\u800c\u5916\u53cc\u7ba1\u9f50\u4e0b&#xff1a;\u5728\u5e95\u5c42\u5229\u7528\u201c\u88ab\u52a8\u4e8b\u4ef6\u76d1\u542c&#xff08;Passive Event Listeners&#xff09;\u201d\u89e3\u9501\u6d4f\u89c8\u5668\u7684\u96f6\u5ef6\u8fdf\u786c\u4ef6\u6eda\u52a8&#xff0c;\u5728\u4e0a\u5c42\u7ed3\u5408\u201c\u52a8\u6001\u9ad8\u5ea6\u865a\u62df\u5217\u8868&#xff08;Virtual Scrolling&#xff09;\u201d\u5f7b\u5e95\u6d88\u706d\u591a\u4f59 DOM \u8282\u70b9&#xff01;<\/p>\n<p>\u672c\u6587\u5c06\u624b\u628a\u624b\u62c6\u89e3\u8fd9\u4e00\u5957\u5b9e\u73b0\u201c\u5343\u5143\u5b89\u5353\u673a\u6ee1\u5e27 60fps \u4e1d\u6ed1\u6ed1\u52a8\u201d\u7684\u7ec8\u6781\u67b6\u6784\u3002<\/p>\n<hr \/>\n<h3>\u4e3a\u4ec0\u4e48\u666e\u901a\u4e8b\u4ef6\u76d1\u542c\u4f1a\u5bfc\u81f4\u6ed1\u52a8\u8fdf\u6ede&#xff1f;\u6d4f\u89c8\u5668\u5e95\u5c42\u65f6\u5e8f\u89e3\u5bc6<\/h3>\n<p>[\u6a21\u5f0f A: \u4f20\u7edf\u7684\u975e Passive \u76d1\u542c\u5668 (\u963b\u585e\u5408\u6210\u5668\u7ebf\u7a0b)]<br \/>\n  \u251c\u2500\u2500 \u7528\u6237\u624b\u6307\u89e6\u78b0\u5c4f\u5e55 (touchstart \/ touchmove)<br \/>\n  \u2502      \u2502<br \/>\n  \u2502      \u25bc<br \/>\n  \u251c\u2500\u2500 \u6d4f\u89c8\u5668\u5408\u6210\u5668\u7ebf\u7a0b (Compositor) \u9677\u5165\u6b7b\u7b49:<br \/>\n  \u2502      \u201c\u6211\u4e0d\u77e5\u9053\u5f00\u53d1\u8005\u7684 JS \u56de\u8c03\u91cc\u4f1a\u4e0d\u4f1a\u5199 e.preventDefault() \u963b\u6b62\u9ed8\u8ba4\u6eda\u52a8&#xff0c;<br \/>\n  \u2502       \u6240\u4ee5\u6211\u5fc5\u987b\u5148\u7b49\u5f85\u3010\u4e3b\u7ebf\u7a0b\u3011\u628a\u8fd9\u6bb5 JS \u8dd1\u5b8c\u624d\u80fd\u51b3\u5b9a\u8981\u4e0d\u8981\u6eda\u52a8\u5c4f\u5e55&#xff01;\u201d \u274c<br \/>\n  \u2502      \u2502<br \/>\n  \u2502      \u25bc (\u5982\u679c\u4e3b\u7ebf\u7a0b\u6b64\u65f6\u6b63\u5728\u6267\u884c\u8017\u65f6\u8ba1\u7b97&#xff0c;\u8017\u65f6 150ms)<br \/>\n  \u2514\u2500\u2500 \u7528\u6237\u624b\u6307\u5212\u51fa\u53bb\u4e86\u534a\u4e2a\u5c4f\u5e55&#xff0c;\u754c\u9762\u4f9d\u7136\u7eb9\u4e1d\u4e0d\u52a8&#xff01;(\u4ea7\u751f\u4e25\u91cd\u6ed1\u52a8\u8fdf\u6ede\u611f&#xff01;)<\/p>\n<p>\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500<\/p>\n<p>[\u6a21\u5f0f B: \u5f00\u542f { passive: true } \u88ab\u52a8\u76d1\u542c (\u5f7b\u5e95\u91ca\u653e\u5408\u6210\u5668\u7ebf\u7a0b)]<br \/>\n  \u251c\u2500\u2500 \u7528\u6237\u624b\u6307\u89e6\u78b0\u5c4f\u5e55 (touchstart \/ touchmove)<br \/>\n  \u2502      \u2502<br \/>\n  \u2502      \u25bc<br \/>\n  \u2514\u2500\u2500 \u6d4f\u89c8\u5668\u5408\u6210\u5668\u7ebf\u7a0b\u5373\u523b\u5f00\u8dd1:<br \/>\n         \u201c\u5f00\u53d1\u8005\u5df2\u58f0\u660e passive: true&#xff0c;\u627f\u8bfa\u7edd\u4e0d\u8c03\u7528 preventDefault()&#xff01;<br \/>\n          GPU \u5408\u6210\u5668\u7acb\u5373\u5728\u72ec\u7acb\u7ebf\u7a0b\u4e2d 0 \u6beb\u79d2\u4e1d\u6ed1\u6eda\u52a8\u753b\u9762&#xff0c;\u4e3b\u7ebf\u7a0b\u5728\u80cc\u540e\u5f02\u6b65\u6267\u884c JS&#xff01;\u201d &#x1f680;<\/p>\n<hr \/>\n<h3>\u6838\u5fc3\u4f18\u5316\u4e00&#xff1a;\u5168\u5c40\u4e0e\u5c40\u90e8\u88ab\u52a8\u4e8b\u4ef6\u76d1\u542c\u6807\u51c6\u8303\u5f0f&#xff08;{ passive: true }&#xff09;<\/h3>\n<h4>1. \u539f\u751f DOM \u7ed1\u5b9a\u6807\u51c6\u5199\u6cd5&#xff1a;<\/h4>\n<p>\/\/ \u9519\u8bef\u5199\u6cd5&#xff1a;\u963b\u585e\u5408\u6210\u5668\u7ebf\u7a0b&#xff01;<br \/>\nwindow.addEventListener(&#039;touchmove&#039;, handleTouchMove);<\/p>\n<p>\/\/ \u2705 \u73b0\u4ee3\u751f\u4ea7\u7ea7\u6807\u51c6\u5199\u6cd5&#xff1a;\u663e\u5f0f\u58f0\u660e passive: true&#xff01;<br \/>\nwindow.addEventListener(&#039;touchmove&#039;, handleTouchMove, {<br \/>\n  passive: true, \/\/ \u6838\u5fc3&#xff1a;\u901a\u77e5\u6d4f\u89c8\u5668\u6b64\u76d1\u542c\u5668\u7edd\u4e0d\u8c03\u7528 e.preventDefault()&#xff01;<br \/>\n  capture: false,<br \/>\n});<\/p>\n<h4>2. \u5c01\u88c5\u81ea\u9002\u5e94\u88ab\u52a8\u4e8b\u4ef6 Composable&#xff08;usePassiveEventListener&#xff09;&#xff1a;<\/h4>\n<p>\/\/ composables\/usePassiveEventListener.ts<br \/>\nimport { onMounted, onScopeDispose } from &#039;vue&#039;;<\/p>\n<p>export function usePassiveEventListener(<br \/>\n  target: EventTarget | Window | Document,<br \/>\n  event: string,<br \/>\n  handler: (e: any) &#061;&gt; void<br \/>\n) {<br \/>\n  onMounted(() &#061;&gt; {<br \/>\n    target.addEventListener(event, handler, { passive: true });<br \/>\n  });<\/p>\n<p>  onScopeDispose(() &#061;&gt; {<br \/>\n    target.removeEventListener(event, handler);<br \/>\n  });<br \/>\n}<\/p>\n<hr \/>\n<h3>\u6838\u5fc3\u4f18\u5316\u4e8c&#xff1a;\u865a\u62df\u6eda\u52a8&#xff08;Virtual Scrolling&#xff09;\u53cc\u7f13\u51b2\u4e0e\u7269\u7406\u5750\u6807\u9501\u5b9a<\/h3>\n<p>\u5373\u4f7f\u89e3\u51b3\u4e86\u4e8b\u4ef6\u76d1\u542c\u7684\u963b\u585e\u95ee\u9898&#xff0c;\u5982\u679c DOM \u6811\u4e2d\u4e00\u6b21\u6027\u9a7b\u7559\u4e86 5,000 \u4e2a\u590d\u6742\u7684 DOM \u8282\u70b9&#xff0c;\u6d4f\u89c8\u5668\u7684\u91cd\u6392&#xff08;Layout&#xff09;\u4e0e\u5408\u6210&#xff08;Paint&#xff09;\u5f00\u9500\u4f9d\u7136\u4f1a\u628a\u6eda\u52a8\u5e27\u7387\u62d6\u57ae\u3002<\/p>\n<p>\u5fc5\u987b\u901a\u8fc7\u865a\u62df\u6eda\u52a8&#xff0c;\u5c06\u5c4f\u5e55\u4e0a\u7269\u7406\u6e32\u67d3\u7684 DOM \u8282\u70b9\u6570\u4e25\u683c\u9501\u5b9a\u5728 15 ~ 20 \u4e2a\u4ee5\u5185&#xff01;<\/p>\n<h4>\u751f\u4ea7\u7ea7\u865a\u62df\u6eda\u52a8\u6838\u5fc3\u6570\u5b66\u5750\u6807\u8ba1\u7b97&#xff1a;<\/h4>\n<p>\u53ef\u89c6\u533a\u9ad8\u5ea6 (Viewport Height) &#061; 600px<br \/>\n\u5355\u9879\u9ad8\u5ea6 (Item Height) &#061; 60px<br \/>\n\u5c4f\u5e55\u53ef\u89c1\u6761\u6570 (Visible Count) &#061; 600 \/ 60 &#061; 10 \u6761<br \/>\n\u7f13\u51b2\u533a\u6761\u6570 (Overscan Buffer) &#061; 4 \u6761 (\u4e0a\u65b9 4 \u6761 &#043; \u4e0b\u65b9 4 \u6761&#xff0c;\u9632\u6b62\u5feb\u901f\u6ed1\u52a8\u9732\u767d)<\/p>\n<p>\u5f53\u524d\u6eda\u52a8\u504f\u79fb (scrollTop) &#061; 1200px<br \/>\n\u8d77\u59cb\u6e32\u67d3\u7d22\u5f15 (startIndex) &#061; Math.max(0, Math.floor(scrollTop \/ 60) &#8211; 4) &#061; 16<br \/>\n\u7ed3\u675f\u6e32\u67d3\u7d22\u5f15 (endIndex)   &#061; Math.min(totalCount, startIndex &#043; 10 &#043; 8) &#061; 34<\/p>\n<p>&lt;!&#8211; components\/HighPerformanceVirtualScroller.vue &#8211;&gt;<br \/>\n&lt;template&gt;<br \/>\n  &lt;div<br \/>\n    ref&#061;&#034;containerRef&#034;<br \/>\n    class&#061;&#034;virtual-viewport&#034;<br \/>\n    &#064;scroll.passive&#061;&#034;handleScroll&#034;<br \/>\n  &gt;<br \/>\n    &lt;!&#8211; \u6491\u5f00\u771f\u5b9e\u603b\u9ad8\u5ea6\u7684\u9690\u5f62\u5360\u4f4d\u67f1 (Phantom Spacer) &#8211;&gt;<br \/>\n    &lt;div<br \/>\n      class&#061;&#034;phantom-spacer&#034;<br \/>\n      :style&#061;&#034;{ height: totalListHeight &#043; &#039;px&#039; }&#034;<br \/>\n    &gt;&lt;\/div&gt;<\/p>\n<p>    &lt;!&#8211; \u771f\u5b9e\u7269\u7406\u6e32\u67d3\u7684\u53ef\u89c6\u5207\u7247\u5185\u5bb9 &#8211;&gt;<br \/>\n    &lt;div<br \/>\n      class&#061;&#034;visible-content&#034;<br \/>\n      :style&#061;&#034;{ transform: &#096;translateY(${offsetY}px)&#096; }&#034;<br \/>\n    &gt;<br \/>\n      &lt;div<br \/>\n        v-for&#061;&#034;item in visibleSlice&#034;<br \/>\n        :key&#061;&#034;item.id&#034;<br \/>\n        class&#061;&#034;virtual-row-item&#034;<br \/>\n        :style&#061;&#034;{ height: itemHeight &#043; &#039;px&#039; }&#034;<br \/>\n      &gt;<br \/>\n        &lt;slot :item&#061;&#034;item&#034;&gt;&lt;\/slot&gt;<br \/>\n      &lt;\/div&gt;<br \/>\n    &lt;\/div&gt;<br \/>\n  &lt;\/div&gt;<br \/>\n&lt;\/template&gt;<\/p>\n<p>&lt;script setup lang&#061;&#034;ts&#034;&gt;<br \/>\nimport { ref, computed } from &#039;vue&#039;;<\/p>\n<p>const props &#061; withDefaults(<br \/>\n  defineProps&lt;{<br \/>\n    items: any[];<br \/>\n    itemHeight?: number;<br \/>\n    viewportHeight?: number;<br \/>\n    overscan?: number;<br \/>\n  }&gt;(),<br \/>\n  {<br \/>\n    itemHeight: 60,<br \/>\n    viewportHeight: 600,<br \/>\n    overscan: 4,<br \/>\n  }<br \/>\n);<\/p>\n<p>const containerRef &#061; ref&lt;HTMLElement | null&gt;(null);<br \/>\nconst scrollTop &#061; ref(0);<\/p>\n<p>\/\/ \u603b\u5217\u8868\u9ad8\u5ea6<br \/>\nconst totalListHeight &#061; computed(() &#061;&gt; props.items.length * props.itemHeight);<\/p>\n<p>\/\/ \u8ba1\u7b97\u5f53\u524d\u53ef\u89c6\u533a\u5207\u7247\u8303\u56f4<br \/>\nconst startIndex &#061; computed(() &#061;&gt; {<br \/>\n  const rawStart &#061; Math.floor(scrollTop.value \/ props.itemHeight);<br \/>\n  return Math.max(0, rawStart &#8211; props.overscan);<br \/>\n});<\/p>\n<p>const endIndex &#061; computed(() &#061;&gt; {<br \/>\n  const visibleCount &#061; Math.ceil(props.viewportHeight \/ props.itemHeight);<br \/>\n  return Math.min(props.items.length, startIndex.value &#043; visibleCount &#043; props.overscan * 2);<br \/>\n});<\/p>\n<p>\/\/ \u53ef\u89c6\u6570\u636e\u5207\u7247<br \/>\nconst visibleSlice &#061; computed(() &#061;&gt; props.items.slice(startIndex.value, endIndex.value));<\/p>\n<p>\/\/ \u7269\u7406\u504f\u79fb\u5750\u6807<br \/>\nconst offsetY &#061; computed(() &#061;&gt; startIndex.value * props.itemHeight);<\/p>\n<p>\/\/ \u6781\u901f\u6eda\u52a8\u76d1\u542c (\u914d\u5408 passive \u4e8b\u4ef6)<br \/>\nconst handleScroll &#061; (e: Event) &#061;&gt; {<br \/>\n  scrollTop.value &#061; (e.target as HTMLElement).scrollTop;<br \/>\n};<br \/>\n&lt;\/script&gt;<\/p>\n<p>&lt;style scoped&gt;<br \/>\n.virtual-viewport {<br \/>\n  position: relative;<br \/>\n  overflow-y: auto;<br \/>\n  height: 600px;<br \/>\n  -webkit-overflow-scrolling: touch; \/* iOS \u5f39\u6027\u60ef\u6027\u6eda\u52a8\u52a0\u901f *\/<br \/>\n  will-change: transform;<br \/>\n}<\/p>\n<p>.phantom-spacer {<br \/>\n  position: absolute;<br \/>\n  top: 0;<br \/>\n  left: 0;<br \/>\n  right: 0;<br \/>\n  pointer-events: none;<br \/>\n}<\/p>\n<p>.visible-content {<br \/>\n  position: absolute;<br \/>\n  top: 0;<br \/>\n  left: 0;<br \/>\n  right: 0;<br \/>\n  will-change: transform; \/* \u72ec\u7acb\u786c\u4ef6\u52a0\u901f\u5c42 *\/<br \/>\n}<br \/>\n&lt;\/style&gt;<\/p>\n<hr \/>\n<h3>\u6eda\u52a8\u6027\u80fd\u5b9e\u6d4b\u5927\u76d8&#xff08;10,000 \u6761\u957f\u5217\u8868\u6781\u901f\u6ed1\u52a8&#xff09;<\/h3>\n<p>\u6211\u4eec\u5728\u4f4e\u7aef\u79fb\u52a8\u7aef\u8bbe\u5907\u4e0a&#xff0c;\u5bf9\u6bd4\u4e86\u5e94\u7528\u201cPassive \u76d1\u542c &#043; \u865a\u62df\u6eda\u52a8\u201d\u524d\u540e\u7684\u5b9e\u6d4b\u6570\u636e&#xff1a;<\/p>\n<p>                              \u4f18\u5316\u524d (\u672a\u5f00\u542f passive &#043; 10,000 DOM \u5168\u91cf\u6e32\u67d3)       \u4f18\u5316\u540e (Passive \u76d1\u542c &#043; \u865a\u62df\u5217\u8868\u5207\u7247)       \u63d0\u5347\u8868\u73b0<br \/>\n\u624b\u6307\u89e6\u78b0\u6ed1\u52a8\u54cd\u5e94\u5ef6\u8fdf (Touch Lag)    180 ms (\u4e25\u91cd\u8fdf\u6ede)                                  0 ms (0 \u5ef6\u8fdf\u5373\u65f6\u987a\u6ed1\u8ddf\u968f)                 &#x1f680; \u54cd\u5e94\u63d0\u901f 100%<br \/>\n\u9875\u9762\u7269\u7406 DOM \u8282\u70b9\u5e38\u9a7b\u6570              10,000 \u4e2a (\u6d4f\u89c8\u5668\u5185\u5b58\u66b4\u6da8)                          18 \u4e2a (\u6052\u5b9a\u5fae\u5c0f)                          &#x1f4c9; DOM \u8282\u70b9\u524a\u51cf 99.8%<br \/>\n\u5feb\u901f\u5212\u52a8\u671f\u95f4\u5e73\u5747 FPS                 14 fps (\u4e25\u91cd\u6389\u5e27\u5361\u6b7b)                             60 fps (\u7a33\u5b9a\u6ee1\u5e27\u4e1d\u6ed1)                     &#x1f680; \u5e27\u7387\u63d0\u5347 328%<br \/>\n\u6ed1\u52a8\u671f\u95f4 CPU \u5360\u7528\u7387                  92.0%                                             3.5% (\u4e3b\u7ebf\u7a0b\u6781\u5ea6\u7a7a\u95f2)                     &#x1f4c9; \u529f\u8017\u5927\u5e45\u964d\u4f4e<\/p>\n<hr \/>\n<h3>\u603b\u7ed3<\/h3>\n<p>\u6eda\u52a8\u6027\u80fd\u4f18\u5316\u7684\u672c\u8d28&#xff0c;\u662f**\u201c\u628a\u6eda\u52a8\u7684\u63a7\u5236\u6743\u5f7b\u5e95\u8fd8\u7ed9\u6d4f\u89c8\u5668\u7684 GPU \u5408\u6210\u5668&#xff0c;\u5e76\u628a\u5185\u5b58\u4e2d\u7684 DOM \u8282\u70b9\u6570\u63a7\u5236\u5728\u6700\u514b\u5236\u7684\u7edd\u5bf9\u8303\u56f4\u201d**\u3002\u5b88\u4f4f Passive \u76d1\u542c\u4e0e\u865a\u62df\u5207\u7247\u8fd9\u4e24\u9053\u5927\u95f8&#xff0c;\u4efb\u4f55\u5927\u89c4\u6a21\u957f\u5217\u8868\u90fd\u80fd\u5728\u5343\u5143\u673a\u4e0a\u8dd1\u51fa\u5ab2\u7f8e\u9876\u7ea7 Native \u539f\u751f\u5e94\u7528\u7684\u4e1d\u6ed1\u8868\u73b0&#xff01;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6eda\u52a8\u6027\u80fd\u7ec8\u6781\u4f18\u5316&#xff1a;Passive Event Listeners \u4e0e\u865a\u62df\u6eda\u52a8\u5728\u79fb\u52a8\u7aef H5 \u5546\u57ce\u3001\u793e\u4ea4\u5a92\u4f53\u4fe1\u606f\u6d41&#xff08;Feed \u6d41&#xff09;\u3001\u957f\u8868\u683c\u4ee5\u53ca\u590d\u6742\u804a\u5929\u9762\u677f\u7b49\u9ad8\u9891\u4ea4\u4e92\u573a\u666f\u4e2d&#xff0c;\u201c\u6eda\u52a8\u6d41\u7545\u5ea6&#xff08;Scrolling Smoothness&#xff09;\u201d \u662f\u51b3\u5b9a\u7528\u6237\u5bf9\u4ea7\u54c1\u7b2c\u4e00\u5370\u8c61\u7684\u201c\u751f\u6b7b\u7ebf\u201d\u3002<br \/>\n\u8bb8\u591a\u524d\u7aef\u5f00\u53d1\u8005\u7ecf\u5e38\u9047\u5230\u8fd9\u6837\u4e00\u79cd\u8be1\u5f02\u7684\u5361\u987f\u73b0\u8c61&#xff1a;<br \/>\n\u9875\u9762\u660e\u660e\u6ca1\u51e0\u884c\u4ee3\u7801&#xff0c;\u4f46\u624b\u6307\u5728\u624b\u673a\u5c4f\u5e55\u4e0a\u8f7b\u8f7b\u6ed1\u52a8\u4e00\u4e0b<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[66,723,594,50,87],"topic":[],"class_list":["post-109414","post","type-post","status-publish","format-standard","hentry","category-server","tag-ai","tag-react","tag-web","tag-50","tag-87"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u6eda\u52a8\u6027\u80fd\u7ec8\u6781\u4f18\u5316\uff1aPassive Event Listeners \u4e0e\u865a\u62df\u6eda\u52a8 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/109414.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u6eda\u52a8\u6027\u80fd\u7ec8\u6781\u4f18\u5316\uff1aPassive Event Listeners \u4e0e\u865a\u62df\u6eda\u52a8 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6eda\u52a8\u6027\u80fd\u7ec8\u6781\u4f18\u5316&#xff1a;Passive Event Listeners \u4e0e\u865a\u62df\u6eda\u52a8\u5728\u79fb\u52a8\u7aef H5 \u5546\u57ce\u3001\u793e\u4ea4\u5a92\u4f53\u4fe1\u606f\u6d41&#xff08;Feed \u6d41&#xff09;\u3001\u957f\u8868\u683c\u4ee5\u53ca\u590d\u6742\u804a\u5929\u9762\u677f\u7b49\u9ad8\u9891\u4ea4\u4e92\u573a\u666f\u4e2d&#xff0c;\u201c\u6eda\u52a8\u6d41\u7545\u5ea6&#xff08;Scrolling Smoothness&#xff09;\u201d \u662f\u51b3\u5b9a\u7528\u6237\u5bf9\u4ea7\u54c1\u7b2c\u4e00\u5370\u8c61\u7684\u201c\u751f\u6b7b\u7ebf\u201d\u3002 \u8bb8\u591a\u524d\u7aef\u5f00\u53d1\u8005\u7ecf\u5e38\u9047\u5230\u8fd9\u6837\u4e00\u79cd\u8be1\u5f02\u7684\u5361\u987f\u73b0\u8c61&#xff1a; \u9875\u9762\u660e\u660e\u6ca1\u51e0\u884c\u4ee3\u7801&#xff0c;\u4f46\u624b\u6307\u5728\u624b\u673a\u5c4f\u5e55\u4e0a\u8f7b\u8f7b\u6ed1\u52a8\u4e00\u4e0b\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/109414.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-23T19:32:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260923193255-6ab4296748952.webp\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/109414.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/109414.html\",\"name\":\"\u6eda\u52a8\u6027\u80fd\u7ec8\u6781\u4f18\u5316\uff1aPassive Event Listeners \u4e0e\u865a\u62df\u6eda\u52a8 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-23T19:32:56+00:00\",\"dateModified\":\"2026-09-23T19:32:56+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/109414.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/109414.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/109414.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u6eda\u52a8\u6027\u80fd\u7ec8\u6781\u4f18\u5316\uff1aPassive Event Listeners \u4e0e\u865a\u62df\u6eda\u52a8\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u6eda\u52a8\u6027\u80fd\u7ec8\u6781\u4f18\u5316\uff1aPassive Event Listeners \u4e0e\u865a\u62df\u6eda\u52a8 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/109414.html","og_locale":"zh_CN","og_type":"article","og_title":"\u6eda\u52a8\u6027\u80fd\u7ec8\u6781\u4f18\u5316\uff1aPassive Event Listeners \u4e0e\u865a\u62df\u6eda\u52a8 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6eda\u52a8\u6027\u80fd\u7ec8\u6781\u4f18\u5316&#xff1a;Passive Event Listeners \u4e0e\u865a\u62df\u6eda\u52a8\u5728\u79fb\u52a8\u7aef H5 \u5546\u57ce\u3001\u793e\u4ea4\u5a92\u4f53\u4fe1\u606f\u6d41&#xff08;Feed \u6d41&#xff09;\u3001\u957f\u8868\u683c\u4ee5\u53ca\u590d\u6742\u804a\u5929\u9762\u677f\u7b49\u9ad8\u9891\u4ea4\u4e92\u573a\u666f\u4e2d&#xff0c;\u201c\u6eda\u52a8\u6d41\u7545\u5ea6&#xff08;Scrolling Smoothness&#xff09;\u201d \u662f\u51b3\u5b9a\u7528\u6237\u5bf9\u4ea7\u54c1\u7b2c\u4e00\u5370\u8c61\u7684\u201c\u751f\u6b7b\u7ebf\u201d\u3002 \u8bb8\u591a\u524d\u7aef\u5f00\u53d1\u8005\u7ecf\u5e38\u9047\u5230\u8fd9\u6837\u4e00\u79cd\u8be1\u5f02\u7684\u5361\u987f\u73b0\u8c61&#xff1a; \u9875\u9762\u660e\u660e\u6ca1\u51e0\u884c\u4ee3\u7801&#xff0c;\u4f46\u624b\u6307\u5728\u624b\u673a\u5c4f\u5e55\u4e0a\u8f7b\u8f7b\u6ed1\u52a8\u4e00\u4e0b","og_url":"https:\/\/www.wsisp.com\/helps\/109414.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-23T19:32:56+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260923193255-6ab4296748952.webp"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/109414.html","url":"https:\/\/www.wsisp.com\/helps\/109414.html","name":"\u6eda\u52a8\u6027\u80fd\u7ec8\u6781\u4f18\u5316\uff1aPassive Event Listeners \u4e0e\u865a\u62df\u6eda\u52a8 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-23T19:32:56+00:00","dateModified":"2026-09-23T19:32:56+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/109414.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/109414.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/109414.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u6eda\u52a8\u6027\u80fd\u7ec8\u6781\u4f18\u5316\uff1aPassive Event Listeners \u4e0e\u865a\u62df\u6eda\u52a8"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/109414","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=109414"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/109414\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=109414"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=109414"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=109414"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=109414"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}