我需要完成循环打印,代码如下:
initSpread(spread) {
if (this.num > this.labelList.length) return
this.spread = spread;
var sheet = this.spread.getActiveSheet();
//this.showData = this.labelList[this.num];
console.log(this.labelList[this.num-1]);
var source = new GC.Spread.Sheets.Bindings.CellBindingSource(this.labelList[this.num-1]);
sheet.setDataSource(source);
this.spread.print();
this.num++
//this.initSpread(this.spread).then(res => {});
this.initSpread(this.spread);
},
但是,发现会执行完所有循环之后,才会调用print的方法,只打印最后一次的数据;
|
|