spz-intersection-observer-polyfill

何时使用

spz-intersection-observer-polyfill 为不原生支持 IntersectionObserver API 的浏览器安装 polyfill。这是一个服务组件 — 没有可见的 UI,也不需要配置。

使用方式

在页面中引入脚本标签,组件加载时会自动安装 polyfill:

<script async custom-element="spz-intersection-observer-polyfill"
  src="https://cdn.shoplazza.com/cuttlefish/v0/spz-intersection-observer-polyfill-0.1.js">
</script>

注意事项

  • 这是一个服务扩展,不是可视化组件。没有属性、action、事件或布局。
  • 仅在浏览器不支持原生 IntersectionObserver 时才会安装 polyfill。
  • 其他依赖 IntersectionObserver 的 SPZ 组件会自动受益。