代码之家  ›  专栏  ›  技术社区  ›  Chris

考虑将事件处理程序标记为“被动”以使页面更具响应性,但通过passive:true OR 假的?

  •  0
  • Chris  · 技术社区  · 4 年前

    我在chrome中发现了一个看似常见的性能冲突,文档中说要添加{passive:true }但我注意到任何一个都会让警告消失。

    .on('touchstart.zoom', null, { passive: true })
    .on('touchstart.zoom', null, { passive: false})
    

    .on('touchstart.zoom', null)
    

    0 回复  |  直到 4 年前