2017-05-26 21:28:06 +02:00
# Browser support
2017-04-01 01:57:13 +02:00
2017-07-30 00:03:22 +08:00
# 浏览器支持
2017-04-01 01:57:13 +02:00
2017-02-22 18:09:39 +00:00
Angular supports most recent browsers. This includes the following specific versions:
2017-07-23 11:51:25 +08:00
Angular 支持大多数常用浏览器,包括下列版本:
2017-02-22 18:09:39 +00:00
< table >
< tr >
2018-01-30 12:56:20 -08:00
< th >
2018-03-03 21:06:01 +08:00
2018-01-30 12:56:20 -08:00
Browser
2018-03-03 21:06:01 +08:00
浏览器
2018-01-30 12:56:20 -08:00
< / th >
2017-02-22 18:09:39 +00:00
2018-01-30 12:56:20 -08:00
< th >
2018-03-03 21:06:01 +08:00
2018-01-30 12:56:20 -08:00
Supported versions
2018-03-03 21:06:01 +08:00
支持的版本
2018-01-30 12:56:20 -08:00
< / th >
2017-02-22 18:09:39 +00:00
< / tr >
< tr >
< td >
2018-03-03 21:06:01 +08:00
2018-01-30 12:56:20 -08:00
Chrome
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
< / td >
< td >
2017-07-23 11:51:25 +08:00
2018-03-03 21:06:01 +08:00
latest
2017-07-23 11:51:25 +08:00
2018-03-03 21:06:01 +08:00
最新版
2017-07-23 11:51:25 +08:00
2017-02-22 18:09:39 +00:00
< / td >
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
< / tr >
< tr >
< td >
2018-03-03 21:06:01 +08:00
2018-01-30 12:56:20 -08:00
Firefox
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
< / td >
< td >
2018-03-03 21:06:01 +08:00
2018-01-30 12:56:20 -08:00
latest
2018-03-03 21:06:01 +08:00
最新版
2017-02-22 18:09:39 +00:00
< / td >
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
< / tr >
< tr >
< td >
2018-03-03 21:06:01 +08:00
2018-01-30 12:56:20 -08:00
Edge
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
< / td >
< td >
2018-03-03 21:06:01 +08:00
2018-01-30 12:56:20 -08:00
2 most recent major versions
2018-03-03 21:06:01 +08:00
最近的两个主版本
2017-02-22 18:09:39 +00:00
< / td >
2018-03-03 21:06:01 +08:00
2018-01-30 12:56:20 -08:00
< / tr >
< tr >
2017-02-22 18:09:39 +00:00
< td >
2018-03-03 21:06:01 +08:00
2018-01-30 12:56:20 -08:00
IE
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
< / td >
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
< td >
2018-03-03 21:06:01 +08:00
2020-01-11 18:10:12 +08:00
11, 10, 9
("compatibility view" mode not supported)
11, 10, 9( 不支持“兼容视图”模式)
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
< / td >
2018-03-03 21:06:01 +08:00
2018-01-30 12:56:20 -08:00
< / tr >
< tr >
< tr >
2017-02-22 18:09:39 +00:00
< td >
2018-03-03 21:06:01 +08:00
2018-01-30 12:56:20 -08:00
IE Mobile
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
< / td >
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
< td >
2018-03-03 21:06:01 +08:00
2018-01-30 12:56:20 -08:00
11
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
< / td >
2018-03-03 21:06:01 +08:00
2018-01-30 12:56:20 -08:00
< / tr >
< tr >
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
< td >
2018-03-03 21:06:01 +08:00
2018-01-30 12:56:20 -08:00
Safari
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
< / td >
< td >
2018-03-03 21:06:01 +08:00
2018-01-30 12:56:20 -08:00
2 most recent major versions
2018-03-03 21:06:01 +08:00
最近的两个主版本
2017-02-22 18:09:39 +00:00
< / td >
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
< / tr >
< tr >
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
< td >
2018-03-03 21:06:01 +08:00
2018-01-30 12:56:20 -08:00
iOS
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
< / td >
< td >
2018-03-03 21:06:01 +08:00
2018-01-30 12:56:20 -08:00
2 most recent major versions
2018-03-03 21:06:01 +08:00
最近的两个主版本
2017-02-22 18:09:39 +00:00
< / td >
2018-03-03 21:06:01 +08:00
2019-06-18 12:40:25 -07:00
< / tr >
2018-01-30 12:56:20 -08:00
< tr >
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
< td >
2018-03-03 21:06:01 +08:00
2018-01-30 12:56:20 -08:00
Android
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
< / td >
< td >
2018-03-03 21:06:01 +08:00
2019-06-25 11:42:26 -07:00
Nougat (7.0), Marshmallow (6.0), Lollipop (5.0, 5.1), KitKat (4.4)
2017-02-22 18:09:39 +00:00
< / td >
2018-03-03 21:06:01 +08:00
2019-06-18 12:40:25 -07:00
< / tr >
2017-02-22 18:09:39 +00:00
< / table >
2018-07-19 15:00:08 -07:00
< div class = "alert is-helpful" >
2017-03-27 16:08:53 +01:00
2017-07-26 13:42:38 +03:00
Angular's continuous integration process runs unit tests of the framework on all of these browsers for every pull request,
using < a href = "https://saucelabs.com/" > SauceLabs< / a > and
2017-04-24 20:23:45 +02:00
< a href = "https://www.browserstack.com" > Browserstack< / a > .
2017-03-27 16:08:53 +01:00
2017-07-23 11:51:25 +08:00
Angular 在持续集成过程中,对每一个提交都会使用 < a href = "https://saucelabs.com/" target = "_blank" > SauceLabs< / a > 和
< a href = "https://www.browserstack.com" target = "_blank" > Browserstack< / a > 在上述所有浏览器上执行单元测试。
2017-04-10 16:51:13 +01:00
< / div >
2017-03-27 16:08:53 +01:00
2017-11-02 14:29:59 -07:00
## Polyfills
2017-04-01 01:57:13 +02:00
2018-02-28 13:17:39 +08:00
## 腻子脚本 (polyfill)
2017-04-01 01:57:13 +02:00
2017-02-22 18:09:39 +00:00
Angular is built on the latest standards of the web platform.
Targeting such a wide range of browsers is challenging because they do not support all features of modern browsers.
2017-11-02 14:29:59 -07:00
You compensate by loading polyfill scripts ("polyfills") for the browsers that you must support.
The [table below ](#polyfill-libs ) identifies most of the polyfills you might need.
2017-02-22 18:09:39 +00:00
2020-01-11 18:10:12 +08:00
Angular 构建于 Web 平台的最新标准之上。
要支持这么多浏览器是一个不小的挑战,因为它们不支持现代浏览器的所有特性。
2018-03-22 17:18:48 +08:00
你可以通过加载腻子脚本("polyfills")来为想要支持的浏览器弥补这些特性。
2018-02-28 13:17:39 +08:00
[下表 ](#polyfill-libs ) 列出了可能用到的大多数腻子脚本。
2017-07-23 11:51:25 +08:00
2017-11-02 14:29:59 -07:00
< div class = "alert is-important" >
2017-07-23 11:51:25 +08:00
2017-11-02 14:29:59 -07:00
The suggested polyfills are the ones that run full Angular applications.
You may need additional polyfills to support features not covered by this list.
Note that polyfills cannot magically transform an old, slow browser into a modern, fast one.
2017-03-27 16:08:53 +01:00
2018-02-28 13:17:39 +08:00
这些建议的腻子脚本是运行完整 Angular 应用所需的。
你可能还会需要另一些的腻子脚本来支持没有出现在此列表中的哪些特性。
注意,这些腻子脚本并没有神奇的魔力来把老旧、慢速的浏览器变成现代、快速的浏览器,它只是填充了 API。
2017-02-22 18:09:39 +00:00
2017-11-02 14:29:59 -07:00
< / div >
2017-04-01 01:57:13 +02:00
2019-06-18 12:40:25 -07:00
In Angular CLI version 8 and higher, applications are built using *differential loading* , a strategy where the CLI builds two separate bundles as part of your deployed application.
2020-01-11 18:10:12 +08:00
在 Angular CLI 版本 8 和更高版本中,应用程序是使用*差异化加载*的方式构建的,*差异化加载*是一种策略, CLI 会构建两个单独的捆绑包作为已部署应用程序的一部分。
2019-06-21 01:39:39 +03:00
* The first bundle contains modern ES2015 syntax, takes advantage of built-in support in modern browsers, ships less polyfills, and results in a smaller bundle size.
2019-06-18 12:40:25 -07:00
2020-01-11 18:10:12 +08:00
第一个捆绑包中包含现代 ES2015 语法,利用了现代浏览器中的内置支持,减少了 polyfill 的发布,并减小了捆绑包的大小。
2019-06-18 12:40:25 -07:00
* The second bundle contains code in the old ES5 syntax, along with all necessary polyfills. This results in a larger bundle size, but supports older browsers.
2017-04-01 01:57:13 +02:00
2020-01-11 18:10:12 +08:00
第二个捆绑包中包含旧 ES5 语法中的代码以及所有必要的 polyfill。这会导致更大的捆绑包大小, 但支持较旧的浏览器。
2017-02-22 18:09:39 +00:00
2017-07-23 11:51:25 +08:00
2019-06-18 12:40:25 -07:00
This strategy allows you to continue to build your web application to support multiple browsers, but only load the necessary code that the browser needs.
For more information about how this works, see [Differential Loading ](guide/deployment#differential-loading ) in the [Deployment guide ](guide/deployment ).
2017-02-22 18:09:39 +00:00
2020-01-11 18:10:12 +08:00
通过此策略,您可以继续构建 Web 应用程序以支持多个浏览器,但仅加载当前浏览器所需的必要代码。有关此工作原理的更多信息,请参见《[部署指南》 ](guide/deployment )中的“[差异化加载 ](guide/deployment#differential-loading ) ”。
2019-06-25 11:42:26 -07:00
## Enabling polyfills with CLI projects
2017-04-01 01:57:13 +02:00
2020-01-11 18:10:12 +08:00
## 在 CLI 项目中启用腻子脚本
2019-06-25 11:42:26 -07:00
The [Angular CLI ](cli ) provides support for polyfills.
If you are not using the CLI to create your projects, see [Polyfill instructions for non-CLI users ](#non-cli ).
2017-02-22 18:09:39 +00:00
2020-01-11 18:10:12 +08:00
[Angular CLI ](cli ) 提供了对腻子脚本的支持。如果未使用 CLI 创建项目,请参阅[针对非 CLI 用户的腻子脚本说明 ](#non-cli )。
2019-06-25 11:42:26 -07:00
When you create a project with the `ng new` command, a `src/polyfills.ts` configuration file is created as part of your project folder.
2017-11-02 14:29:59 -07:00
This file incorporates the mandatory and many of the optional polyfills as JavaScript `import` statements.
2017-07-23 11:51:25 +08:00
2020-01-11 18:10:12 +08:00
使用 `ng new` 命令创建项目时,会在项目文件夹中创建一个 `src/polyfills.ts` 配置文件。该文件包含许多强制性和可选腻子脚本的 JavaScript `import` 语句。
2017-02-22 18:09:39 +00:00
2019-06-25 11:42:26 -07:00
* The npm packages for the [_mandatory_ polyfills ](#polyfill-libs ) (such as `zone.js` ) are installed automatically for you when you create your project with `ng new` , and their corresponding `import` statements are already enabled in the `src/polyfills.ts` configuration file.
2017-04-01 01:57:13 +02:00
2020-01-11 18:10:12 +08:00
使用 `ng new` 创建项目时,会自动为您安装[*强制性* ](#polyfill-libs ) `zone.js` 的 npm 捆绑包(例如 `zone.js` ),并且它对应的 `import` 语句已在 `src/polyfills.ts` 配置文件中启用。
2017-04-01 01:57:13 +02:00
2017-02-22 18:09:39 +00:00
2019-06-25 11:42:26 -07:00
* If you need an _optional_ polyfill, you must install its npm package, then uncomment or create the corresponding import statement in the `src/polyfills.ts` configuration file.
2018-03-03 21:06:01 +08:00
2020-01-11 18:10:12 +08:00
如果需要*可选的*腻子脚本,则必须安装其 npm 捆绑包,然后取消注释或在`src/polyfills.ts` 配置文件中创建相应的import语句。
2018-03-07 10:51:31 +08:00
2019-06-25 11:42:26 -07:00
For example, if you need the optional [web animations polyfill ](http://caniuse.com/#feat=web-animation ), you could install it with `npm` , using the following command (or the `yarn` equivalent):
2017-02-22 18:09:39 +00:00
2020-01-11 18:10:12 +08:00
比如,如果需要可选的 [Web 动画腻子脚本 ](http://caniuse.com/#feat=web-animation ) ,则可以使用以下命令来通过 `npm` (或等效的`yarn` )安装它:
2017-11-02 14:29:59 -07:00
< code-example language = "sh" class = "code-shell" >
2019-06-25 11:42:26 -07:00
# install the optional web animations polyfill
2017-11-02 14:29:59 -07:00
npm install --save web-animations-js
< / code-example >
2017-04-01 01:57:13 +02:00
2019-06-25 11:42:26 -07:00
You can then add the import statement in the `src/polyfills.ts` file.
For many polyfills, you can simply un-comment the corresponding `import` statement in the file, as in the following example.
2017-04-01 01:57:13 +02:00
2020-01-11 18:10:12 +08:00
然后你还要在 `src/polyfills.ts` 文件中添加导入语句。
对于大多数腻子脚本,你可以直接在此文件中反注释对应的 `import` 语句,如下所示。
2017-04-01 01:57:13 +02:00
2018-02-28 08:08:59 +08:00
2018-10-11 13:29:59 +02:00
< code-example header = "src/polyfills.ts" >
2017-11-02 14:29:59 -07:00
/**
2018-03-07 10:51:31 +08:00
2017-11-02 14:29:59 -07:00
* Required to support Web Animations `@angular/platform-browser/animations` .
2018-03-07 10:51:31 +08:00
2017-11-02 14:29:59 -07:00
* Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat =web-animation
** /
import 'web-animations-js'; // Run `npm install --save web-animations-js` .
< / code-example >
2017-02-22 18:09:39 +00:00
2019-06-25 11:42:26 -07:00
If the polyfill you want is not already in `polyfills.ts` file, add the `import` statement by hand.
2017-07-23 11:51:25 +08:00
2020-01-11 18:10:12 +08:00
如果 `polyfills.ts` 文件中没有你想要的腻子脚本,请手动添加 `import` 语句。
2017-02-22 18:09:39 +00:00
2017-11-02 14:29:59 -07:00
{@a polyfill-libs}
2017-04-01 01:57:13 +02:00
2017-11-02 14:29:59 -07:00
### Mandatory polyfills
2017-04-01 01:57:13 +02:00
2018-02-28 13:17:39 +08:00
### 强制性腻子脚本
2017-04-01 01:57:13 +02:00
2017-02-22 18:09:39 +00:00
These are the polyfills required to run an Angular application on each supported browser:
2019-01-27 22:10:45 +08:00
下表中的腻子脚本是每个浏览器中运行 Angular 应用时要用到哪些:
2017-07-23 11:51:25 +08:00
2017-02-22 18:09:39 +00:00
< table >
< tr style = "vertical-align: top" >
2017-07-26 13:42:38 +03:00
2017-02-22 18:09:39 +00:00
< th >
2017-07-23 11:51:25 +08:00
2018-03-03 21:06:01 +08:00
Browsers (Desktop & Mobile)
浏览器(桌面和移动)
2017-08-06 13:37:25 +08:00
2017-02-22 18:09:39 +00:00
< / th >
< th >
2017-07-23 11:51:25 +08:00
2018-03-03 21:06:01 +08:00
Polyfills Required
2017-08-06 13:37:25 +08:00
2018-03-03 21:06:01 +08:00
需要的腻子脚本
2017-07-23 11:51:25 +08:00
2017-02-22 18:09:39 +00:00
< / th >
< / tr >
< tr style = "vertical-align: top" >
2017-07-26 13:42:38 +03:00
2017-02-22 18:09:39 +00:00
< td >
2019-06-25 11:42:26 -07:00
Chrome, Firefox, Edge, < br >
2019-07-23 12:37:49 -07:00
Safari, Android, IE 10+
2017-02-22 18:09:39 +00:00
< / td >
< td >
2017-04-01 01:57:13 +02:00
2019-06-25 11:42:26 -07:00
[ES2015 ](guide/browser-support#core-es6 )
2018-01-30 12:56:20 -08:00
2017-02-22 18:09:39 +00:00
< / td >
< / tr >
< tr style = "vertical-align: top" >
2017-07-26 13:42:38 +03:00
2017-02-22 18:09:39 +00:00
< td >
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
IE9
< / td >
< td >
2017-04-01 01:57:13 +02:00
2019-06-25 11:42:26 -07:00
ES2015< br > [classList ](guide/browser-support#classlist )
2017-04-01 01:57:13 +02:00
2017-02-22 18:09:39 +00:00
< / td >
< / tr >
< / table >
2017-11-02 14:29:59 -07:00
### Optional browser features to polyfill
2017-04-01 01:57:13 +02:00
2018-02-28 13:17:39 +08:00
### 可选浏览器特性的腻子脚本
2017-08-06 13:21:34 +08:00
2017-02-22 18:09:39 +00:00
Some features of Angular may require additional polyfills.
2018-02-28 13:17:39 +08:00
有些 Angular 特性可能需要额外的腻子脚本。
2017-07-23 11:51:25 +08:00
2017-02-22 18:09:39 +00:00
< table >
< tr style = "vertical-align: top" >
2017-07-23 11:51:25 +08:00
2017-02-22 18:09:39 +00:00
< th >
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
Feature
2018-03-03 21:06:01 +08:00
2017-07-30 00:03:22 +08:00
特性
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
< / th >
< th >
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
Polyfill
2018-03-03 21:06:01 +08:00
2018-02-28 13:17:39 +08:00
腻子脚本
2017-07-23 11:51:25 +08:00
2017-02-22 18:09:39 +00:00
< / th >
< th style = "width: 50%" >
2018-03-03 21:06:01 +08:00
Browsers (Desktop & Mobile)
浏览器(桌面和移动)
2017-02-22 18:09:39 +00:00
< / th >
< / tr >
< tr style = "vertical-align: top" >
2017-07-23 11:51:25 +08:00
2017-02-22 18:09:39 +00:00
< td >
2017-11-02 14:29:59 -07:00
2019-06-25 11:42:26 -07:00
[AnimationBuilder ](api/animations/AnimationBuilder ).
(Standard animation support does not require polyfills.)
2018-01-30 12:56:20 -08:00
2020-01-11 18:10:12 +08:00
[AnimationBuilder ](api/animations/AnimationBuilder )。
(支持标准动画不需要腻子脚本。)
2018-01-30 12:56:20 -08:00
2017-02-22 18:09:39 +00:00
< / td >
< td >
2017-04-01 01:57:13 +02:00
2017-03-11 15:36:40 +00:00
[Web Animations ](guide/browser-support#web-animations )
2017-07-23 11:51:25 +08:00
[Web 动画 ](guide/browser-support#web-animations )
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
< / td >
< td >
2019-06-25 11:42:26 -07:00
< p > If AnimationBuilder is used, enables scrubbing
support for IE/Edge and Safari.
(Chrome and Firefox support this natively).< / p >
2020-01-11 18:10:12 +08:00
< p > 如果用到了 AnimationBuilder, 还要启用 IE/Edge 和 Safari 的 scrubbing( 擦除) 支持
( Chrome 和 Firefox 对此提供了原生支持)< / p >
2017-02-22 18:09:39 +00:00
< / td >
< / tr >
< tr style = "vertical-align: top" >
2017-07-23 11:51:25 +08:00
2017-02-22 18:09:39 +00:00
< td >
2017-07-23 11:51:25 +08:00
2018-03-03 21:06:01 +08:00
[NgClass ](api/common/NgClass )
on SVG elements
在 SVG 元素上应用时
2017-02-22 18:09:39 +00:00
< / td >
< td >
2017-07-26 13:42:38 +03:00
2017-04-01 01:57:13 +02:00
[classList ](guide/browser-support#classlist )
2018-01-30 12:56:20 -08:00
2017-02-22 18:09:39 +00:00
< / td >
< td >
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
IE10, IE11
< / td >
< / tr >
< tr style = "vertical-align: top" >
2017-07-23 11:51:25 +08:00
2017-02-22 18:09:39 +00:00
< td >
2017-07-23 11:51:25 +08:00
2018-03-03 21:06:01 +08:00
[Http ](guide/http )
when sending and receiving binary data
用 [Http ](guide/http ) 发送和接收二进制数据时
2017-02-22 18:09:39 +00:00
< / td >
< td >
2017-04-01 01:57:13 +02:00
2018-03-07 10:51:31 +08:00
[Typed Array ](guide/browser-support#typedarray )< br >
2018-03-03 21:06:01 +08:00
2018-03-07 10:51:31 +08:00
[Blob ](guide/browser-support#blob )< br >
2018-01-30 12:56:20 -08:00
2017-07-26 13:42:38 +03:00
[FormData ](guide/browser-support#formdata )
2018-01-30 12:56:20 -08:00
2017-02-22 18:09:39 +00:00
< / td >
< td >
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
IE 9
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
< / td >
< / tr >
2018-11-16 09:19:46 -06:00
< tr style = "vertical-align: top" >
< td >
2019-06-25 11:42:26 -07:00
[Router ](guide/router ) when using
[hash-based routing ](guide/router#appendix-locationstrategy-and-browser-url-styles )
2019-02-17 09:47:12 +08:00
当使用[基于 hash 的路由 ](guide/router#appendix-locationstrategy-and-browser-url-styles )时。
2018-11-16 09:19:46 -06:00
< / td >
< td >
[ES7/array ](guide/browser-support#core-es7-array )
< / td >
< td >
IE 11
< / td >
< / tr >
2017-02-22 18:09:39 +00:00
< / table >
2018-02-28 13:13:29 +08:00
2019-06-25 11:42:26 -07:00
### Suggested polyfills
2020-01-11 18:10:12 +08:00
### 建议的腻子脚本
2017-02-22 18:09:39 +00:00
2019-06-25 11:42:26 -07:00
The following polyfills are used to test the framework itself. They are a good starting point for an application.
2017-02-22 18:09:39 +00:00
2020-01-11 18:10:12 +08:00
下列腻子脚本是用来测试框架本身的。它们是应用程序的优质起点。
2017-07-23 11:51:25 +08:00
2017-02-22 18:09:39 +00:00
< table >
< tr >
< th >
2017-08-06 13:37:25 +08:00
2018-03-03 21:06:01 +08:00
Polyfill
2017-08-06 13:37:25 +08:00
2018-03-03 21:06:01 +08:00
腻子脚本
2017-08-06 13:37:25 +08:00
2017-02-22 18:09:39 +00:00
< / th >
< th >
2017-07-23 11:51:25 +08:00
2018-03-03 21:06:01 +08:00
License
2017-07-23 11:51:25 +08:00
2018-03-03 21:06:01 +08:00
授权方式
2017-07-23 11:51:25 +08:00
2017-02-22 18:09:39 +00:00
< / th >
< th >
2017-07-23 11:51:25 +08:00
2018-03-03 21:06:01 +08:00
Size*
2017-07-23 11:51:25 +08:00
2018-03-03 21:06:01 +08:00
大小*
2017-07-23 11:51:25 +08:00
2017-02-22 18:09:39 +00:00
< / th >
< / tr >
2018-11-16 09:19:46 -06:00
< tr >
< td >
< a id = 'core-es7-array' href = "https://github.com/zloirock/core-js/tree/v2/fn/array" > ES7/array< / a >
< / td >
< td >
MIT
< / td >
< td >
0.1KB
< / td >
< / tr >
2017-02-22 18:09:39 +00:00
< tr >
< td >
2018-01-30 12:56:20 -08:00
2019-06-25 11:42:26 -07:00
< a id = 'core-es6' href = "https://github.com/zloirock/core-js" > ES2015< / a >
2018-01-30 12:56:20 -08:00
2017-02-22 18:09:39 +00:00
< / td >
< td >
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
MIT
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
< / td >
< td >
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
27.4KB
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
< / td >
< / tr >
< tr >
< td >
2018-01-30 12:56:20 -08:00
2017-04-24 20:23:45 +02:00
< a id = 'classlist' href = "https://github.com/eligrey/classList.js" > classList< / a >
2018-01-30 12:56:20 -08:00
2017-02-22 18:09:39 +00:00
< / td >
< td >
2017-07-23 11:51:25 +08:00
2018-03-03 21:06:01 +08:00
Public domain
2017-07-23 11:51:25 +08:00
2018-03-03 21:06:01 +08:00
公共域
2017-07-23 11:51:25 +08:00
2017-02-22 18:09:39 +00:00
< / td >
< td >
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
1KB
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
< / td >
< / tr >
< tr >
< td >
2018-01-30 12:56:20 -08:00
2017-04-24 20:23:45 +02:00
< a id = 'intl' href = "https://github.com/andyearnshaw/Intl.js" > Intl< / a >
2018-01-30 12:56:20 -08:00
2017-02-22 18:09:39 +00:00
< / td >
< td >
2018-03-03 21:06:01 +08:00
2017-03-11 13:44:25 +00:00
MIT / Unicode license
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
< / td >
< td >
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
13.5KB
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
< / td >
< / tr >
< tr >
< td >
2018-03-03 21:06:01 +08:00
2017-04-24 20:23:45 +02:00
< a id = 'web-animations' href = "https://github.com/web-animations/web-animations-js" > Web Animations< / a >
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
< / td >
< td >
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
Apache
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
< / td >
< td >
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
14.8KB
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
< / td >
< / tr >
< tr >
< td >
2018-01-30 12:56:20 -08:00
2017-04-24 20:23:45 +02:00
< a id = 'typedarray' href = "https://github.com/inexorabletash/polyfill/blob/master/typedarray.js" > Typed Array< / a >
2018-01-30 12:56:20 -08:00
2017-02-22 18:09:39 +00:00
< / td >
< td >
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
MIT
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
< / td >
< td >
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
4KB
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
< / td >
< / tr >
< tr >
< td >
2018-01-30 12:56:20 -08:00
2017-04-24 20:23:45 +02:00
< a id = 'blob' href = "https://github.com/eligrey/Blob.js" > Blob< / a >
2018-01-30 12:56:20 -08:00
2017-02-22 18:09:39 +00:00
< / td >
< td >
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
MIT
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
< / td >
< td >
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
1.3KB
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
< / td >
< / tr >
< tr >
< td >
2018-01-30 12:56:20 -08:00
2017-04-24 20:23:45 +02:00
< a id = 'formdata' href = "https://github.com/francois2metz/html5-formdata" > FormData< / a >
2018-01-30 12:56:20 -08:00
2017-02-22 18:09:39 +00:00
< / td >
< td >
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
MIT
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
< / td >
< td >
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
0.4KB
2018-03-03 21:06:01 +08:00
2017-02-22 18:09:39 +00:00
< / td >
< / tr >
< / table >
2018-03-03 21:06:01 +08:00
\* Figures are for minified and gzipped code,
computed with the < a href = "http://closure-compiler.appspot.com/home" > closure compiler< / a > .
2017-08-06 13:37:25 +08:00
2018-03-03 21:06:01 +08:00
\* 这里的数据都按最小化并且 gzip 压缩后的版本算,是由< a href = "http://closure-compiler.appspot.com/home" > closure compiler</ a > 计算出的。
2017-08-06 13:21:34 +08:00
2017-11-02 14:29:59 -07:00
{@a non-cli}
2018-03-03 21:06:01 +08:00
2017-11-02 14:29:59 -07:00
## Polyfills for non-CLI users
2018-03-07 15:42:49 +08:00
## 非 CLI 的用户的腻子脚本
2018-02-28 08:08:59 +08:00
2019-06-25 11:42:26 -07:00
If you are not using the CLI, add your polyfill scripts directly to the host web page (`index.html` ).
2017-11-02 14:29:59 -07:00
2018-02-28 13:17:39 +08:00
如果你不使用 CLI, 就要直接把腻子脚本添加到宿主页( `index.html` )中,就像这样:
2018-02-28 08:08:59 +08:00
2019-06-25 11:42:26 -07:00
For example:
2017-11-02 14:29:59 -07:00
2020-01-11 18:10:12 +08:00
比如:
2019-07-20 20:40:17 +03:00
< code-example header = "src/index.html" language = "html" >
2017-11-02 14:29:59 -07:00
< !-- pre-zone polyfills -->
< script src="node_modules/core-js/client/shim.min.js">< /script>
< script src="node_modules/web-animations-js/web-animations.min.js">< /script>
2018-01-23 01:43:30 +09:00
< script>
/**
2018-03-03 21:06:01 +08:00
2018-01-23 01:43:30 +09:00
* you can configure some zone flags which can disable zone interception for some
2018-03-03 21:06:01 +08:00
2018-01-23 01:43:30 +09:00
* asynchronous activities to improve startup performance - use these options only
2018-03-03 21:06:01 +08:00
2018-01-23 01:43:30 +09:00
* if you know what you are doing as it could result in hard to trace down bugs..
*/
// __Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
// __Zone_disable_on_property = true; // disable patch onProperty such as onclick
2019-07-17 14:16:22 -07:00
// __zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
2017-11-02 14:29:59 -07:00
2018-01-27 13:45:03 +09:00
/*
2018-03-03 21:06:01 +08:00
2018-01-27 13:45:03 +09:00
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
2018-03-03 21:06:01 +08:00
2018-01-27 13:45:03 +09:00
* with the following flag, it will bypass `zone.js` patch for IE/Edge
*/
// __Zone_enable_cross_context_check = true;
< /script>
2017-11-02 14:29:59 -07:00
< !-- zone.js required by Angular -->
< script src="node_modules/zone.js/dist/zone.js">< /script>
< !-- application polyfills -->
< / code-example >