只有当你必须支持下表中某个 API 标记为 ❌ 的环境时,才需要 polyfill。本页中的 polyfill 包/导入仅为建议——只要能提供相同的 API 行为,你可以使用任何等效的 polyfill 解决方案。
浏览器与 API 支持
图例: ❌ 不支持(需要 polyfill) | ✅ 完全支持
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
浏览器兼容性所需的 JavaScript polyfill
| API | Polyfill | iOS 15.0-15.3 | iOS 15.4+ | iOS 16.0+ | Chrome 92+ | Firefox 92+ | Safari 15.4+ | Safari 16.0+ | Samsung 16.0+ |
|---|---|---|---|---|---|---|---|---|---|
structuredClone() | core-js/actual/structured-clone | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Array.at() | core-js/actual/array/at | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Object.hasOwn() | core-js/actual/object/has-own | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Array.findLast() | core-js/actual/array/find-last | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Array.findLastIndex() | core-js/actual/array/find-last-index | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Array.toSpliced() | core-js/actual/array/to-spliced | ❌ | ❌ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ |
Array.toSorted() | core-js/actual/array/to-sorted | ❌ | ❌ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ |
Array.with() | core-js/actual/array/with | ❌ | ❌ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ |
npm install core-js
// Place at the very beginning of your app entry point (before importing the Widget)
import 'core-js'
// Place at the very beginning of your app entry point (before importing the Widget)
import 'core-js/actual/structured-clone'
import 'core-js/actual/array/at'
import 'core-js/actual/object/has-own'
import 'core-js/actual/array/find-last'
import 'core-js/actual/array/find-last-index'
import 'core-js/actual/array/to-spliced'
import 'core-js/actual/array/to-sorted'
import 'core-js/actual/array/with'
