var mockBrowser = require('mock-browser').mocks.MockBrowser;
global.window = mockBrowser.createWindow();
global.document = window.document;
global.navigator = window.navigator;
global.HTMLCollection = window.HTMLCollection;
global.getComputedStyle = window.getComputedStyle;
var fileReader = require('FileReader');
global.FileReader = fileReader;
var GC = require('@grapecity/spread-sheets');
var GCExcel = require('@grapecity/spread-excelio');
GC.Spread.Sheets.LicenseKey = GCExcel.LicenseKey = "*.she******.net,852******"; //隐私代码,部分用*代替了
var packageJson = require('./package.json');
console.log('\n** Using Spreadjs Version "' + packageJson.dependencies["@grapecity/spread-sheets"] + '" **');
var wb = new GC.Spread.Sheets.Workbook();
var sheet = new GC.Spread.Sheets.Worksheet("aa")
wb.addSheet(0, sheet) node app.js运行以上代码,得到错误如下:PS D:\web\demo> node app.js
** Using Spreadjs Version "11.1.0" **
D:\web\demo\node_modules\@grapecity\spread-sheets\dist\gc.spread.sheets.all.min.js:30
var d=this.YTa(a,b);return d.getActualSize(c)},setSize:function(a,b,c,d){var e,f;E(b)&&(b=3),e=this.WTa>0?[[a?"rowInfos":"colInfos",b],m]:m,f=this.YTa(a,b),f.setSize(c,d,e),e&&this.zTa.push(e)},VTa:function(a,b){var c=this.YTa(a,b);return c.VTa()},Hp:function(a,b){var c=this.YTa(a,b);return c.Hp()},Jp:function(a,b,c){var d=this.YTa(a,b);return d.Jp(c)},setItem:function(a,b,c,d){var e,f;E(b)&&(b=3),e=this.WTa>0?[[a?"rowInfos":"colInfos",b],m]:m,f=this.YTa(a,b),f.Kp(c,d,e),e&&this.zTa.push(e)}},u.Zn(R),r.lUa=R,a.exports=r}()},function(a,b,c){!function(){"use strict";var b,d=c(42),e=c(43),f=c(49).oo,g=c(53).Style,h=c(57),i=c(44).GC$,j=c(26),k=e.Ul,l=e.En,m=e.Ul.Nl,n=e.kf,o=j.j.Fa,p=e.ln,q=e.Rect,r=e.Events,s=k.Pl,t=k.Ql,u=k.bq,v=e.Vl,w=e.Im,x=e.Themes,y=e.Theme,z=h.zp,A=h.yp,B=i.each,C=i.isEmptyObject,D=j.l,E=j.D,F=document,G=parseInt,H=parseFloat,I=isNaN,J=null,K=void 0,L=Math.min,M=Math.max,N=Math.floor,O="undefined",P="str
TypeError: Cannot read property 'do' of undefined
at oa.cq (D:\web\demo\node_modules\@grapecity\spread-sheets\dist\gc.spread.sheets.all.min.js:30:4076)
at va.ow (D:\web\demo\node_modules\@grapecity\spread-sheets\dist\gc.spread.sheets.all.min.js:34:1728)
at va.addSheet (D:\web\demo\node_modules\@grapecity\spread-sheets\dist\gc.spread.sheets.all.min.js:34:1538)
at Object.<anonymous> (D:\web\demo\app.js:328:4)
at Module._compile (internal/modules/cjs/loader.js:959:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
at Module.load (internal/modules/cjs/loader.js:815:32)
at Function.Module._load (internal/modules/cjs/loader.js:727:14)
at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
at internal/main/run_main_module.js:17:11 请问如何解决?
|
|