兼容性支持

April 19, 2023 · View on GitHub

Zarm 实现过程中,部分组件使用了较新的 API,这些 API 在低版本浏览器中可能会有兼容问题,导致运行代码逻辑执行失败或者报错。

本文档将公开 Zarm 中涉及到的兼容性不足的 API 的使用,帮助开发者根据项目实际场景选择是否需要添加相关的 polyfill。

API 使用情况列表

使用到的 API涉及组件引入方式最低兼容版本推荐的 polyfill
IntersectionObserveruseInViewport直接使用Android 5 iOS 12.2intersection-observer
ResizeObserverPicker PickerView Select DatePicker DatePickerView DateSelect直接使用Android 5 iOS 13.4resize-observer-polyfill
constBackTop Carousel Pull Rate Slider SwiperAction@use-gesture/react 依赖项Android 5 iOS 11babel
Arrow functionsBackTop Carousel Pull Rate Slider SwiperAction@use-gesture/react 依赖项Android 5 iOS 10babel