我在我的 Wijmo 项目中使用 Angular 4wijmo.xlsx
时遇到了麻烦。需要作为依赖项。JSZip
wijmo.xlsx
JSZip
当我导入JSZip
如下的 TypeScript 文件时,它会显示错误和 for JSZip
。
import * as JSZip from 'jszip';
我安装JSZip
使用npm install jszip --save
但它没有工作。
我@types/jszip
这次安装了,错误消失了。但是当我尝试使用JSZip
它时显示以下错误:
(index):55 (SystemJS) window.require is not a function
TypeError: window.require is not a function at Object.eval
(http://localhost:5555/node_modules/wijmo/wijmo.xlsx.js:13:871)
at eval (http://localhost:5555/node_modules/wijmo/wijmo.xlsx.js:14:4)
at eval (http://localhost:5555/node_modules/wijmo/wijmo.xlsx.js:15:3)
at eval (<anonymous>)
at Object.eval
(http://localhost:5555/node_modules/wijmo/wijmo.grid.xlsx.js:13:694) at eval
(http://localhost:5555/node_modules/wijmo/wijmo.grid.xlsx.js:14:4) at eval
(http://localhost:5555/node_modules/wijmo/wijmo.grid.xlsx.js:15:3) at eval
(<anonymous>)
安装 JSZip 并将其与 Angular 4 一起使用的正确程序是什么?我们需要先安装@types/jszip
然后再安装JSZip
吗?