我的网格布局有问题。我的代码是这个:
<GridLayout padding="10%"columns="auto, auto, auto, auto, auto, auto, auto" rows="*">
<ng-container *ngFor="let item of items">
<label [text]="item.codice" col="0",[row]="{{item.row}}"fontSize="24px"></label>
<label [text]="item.prodotto" col="1",[row]="{{item.row}}"fontSize="24px"></label>
<label [text]="item.lottoData" col="2",[row]="{{item.row}}"fontSize="24px"></label>
<label [text]="item.codiceCont" col="3",[row]="{{item.row}}"fontSize="24px"></label>
<label [text]="item.qtyUntPri" col="4",[row]="{{item.row}}"fontSize="24px"></label>
<label [text]="item.studioCieco" col="5",[row]="{{item.row}}"fontSize="24px"></label>
<label [text]="item.qty" col="6",[row]="{{item.row}}"fontSize="24px"></label>
</ng-container>
</GridLayout>
我希望看到每个项目的这些列和一行,但我有一些你可以在下图中看到的内容:
如果您需要查看打字稿
ngOnInit(): void {
var usefulData = this.data["param"]["response"];
var firstTable = usefulData[0];
var secondTable = usefulData[1];
this.studyCode = firstTable[0]["StudyCode"];
this.nameFile = firstTable[0]["NameFile"];
var row = 1;
for (var i in secondTable){
if(secondTable[i] != undefined){
this.items.push({
codice:secondTable[i]["Codice"],
prodotto:secondTable[i]["Product"],
lottoData:secondTable[i]["LottoData"],
codiceCont:secondTable[i]["CodiceCont"],
qtyUntPri:secondTable[i]["QtyUntPri"],
studioCieco:secondTable[i]["StudioCieco"],
qty:secondTable[i]["Qty"],
row:row
});
row+=1;
}
}
}