1

我在我的 Wijmo 项目中使用 Angular 4wijmo.xlsx时遇到了麻烦。需要作为依赖项。JSZipwijmo.xlsxJSZip

当我导入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吗?

4

1 回答 1

1

如果您需要将其添加为模块,请查看此链接

https://www.grapecity.com/en/forums/wijmo/excelimportexport-in-angul

如果您需要将其添加为文件,请参阅此链接

于 2018-02-26T10:07:39.740 回答