in vue js how to load nested array to a html table. when I use v-for inside v-for it qives an error Property or method "key" is not defined on the instance but referenced during render. Make sure to declare reactive data properties in the data option.
[
{
jobtype_id:"1",
jobtype_code:"L001",
jobtype_name:"Labour",
jobtype_order:"1",
jobtype_comment:"1",
jobs:[
{
jobinvoicedtlid:"1",
JobInvNo:"JBIN0016",
JobCardNo:"",
JobType:"1",
JobCode:null,
JobDescription:"Wheel alignment",
JobQty:"2",
JobPrice:"800.00",
JobTotalAmount:"1600.00",
JobDiscount:"0.00",
JobNetAmount:"1600.00",
JobDiscountType:"1",
JobinvoiceTimestamp:"2147483647",
Description:"Labour"
},
{
jobinvoicedtlid:"2",
JobInvNo:"JBIN0016",
JobCardNo:"",
JobType:"1",
JobCode:null,
JobDescription:"Full Service",
JobQty:"4",
JobPrice:"250.00",
JobTotalAmount:"1000.00",
JobDiscount:"0.00",
JobNetAmount:"1000.00",
JobDiscountType:"1",
JobinvoiceTimestamp:"2147483647",
Description:"Labour"
}
]
},
{
jobtype_id:"2",
jobtype_code:"S002",
jobtype_name:"Parts Outside",
jobtype_order:"3",
jobtype_comment:null,
jobs:[
{
jobinvoicedtlid:"3",
JobInvNo:"JBIN0016",
JobCardNo:"",
JobType:"2",
JobCode:null,
JobDescription:"Oil Change",
JobQty:"5",
JobPrice:"500.00",
JobTotalAmount:"2500.00",
JobDiscount:"0.00",
JobNetAmount:"2500.00",
JobDiscountType:"1",
JobinvoiceTimestamp:"2147483647",
Description:"Parts Outside"
}
]
}
]
<tbody>
<tr v-for="item,key in printdata">
<td colspan='6'> <b>{{item.jobtype_name}}</b></td>
<table border="1">
<tr v-for="itm in printdata.jobs">
<td>itm.JobDescription</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</tr>
</tbody>
this kind of result im expecting enter image description here