3

我将 Angular 5 与 SharePoint SPFX 框架一起使用。页面上的多个 webpart 一切正常,没问题,但我如何包含 Polyfill?我尝试包含在外部的 js 文件中,但不起作用,我尝试只将 polyfills.ts 中的所有内容导入 webpart.ts 文件,没有运气。

任何人都可以帮助解释如何在 IE 中获得 angular 5 和 spfx 渲染,chrome 没有问题,但 webparts 没有在 IE 中显示。

我尝试将这些脚本添加到外部但不工作:

<script src="node_modules/core-js/client/shim.min.js"></script>
<script src="node_modules/web-animations-js/web-animations.min.js"></script>
<script src="node_modules/zone.js/dist/zone.js"></script>
4

1 回答 1

-2

要让 Angular 在 IE 中工作,您必须取消注释 src/polyfills.ts 中的某些行

/** IE9, IE10 and IE11 requires all of the following polyfills. **/
import 'core-js/es6/symbol';
import 'core-js/es6/object';
import 'core-js/es6/function';
import 'core-js/es6/parse-int';
import 'core-js/es6/parse-float';
import 'core-js/es6/number';
import 'core-js/es6/math';
import 'core-js/es6/string';
import 'core-js/es6/date';
import 'core-js/es6/array';
import 'core-js/es6/regexp';
import 'core-js/es6/map';
import 'core-js/es6/set';
于 2018-04-04T13:38:34.873 回答