I am having a JSON data array, I need to loop through outer as well as inner subarray and need to create a Table. Below is the sample array
{
class:'I',
subDdiv:[
{
div: 'A',
subjects:['Subject1','Subject2','Subject3']
},
{
div: 'B',
subjects:['Subject1','Subject2','Subject3']
},
]
}
{
class:'II',
subDdiv:[
{
div: 'A',
subjects:['Subject1','Subject2','Subject3']
},
{
div: 'B',
subjects:['Subject1','Subject2','Subject3']
},
]
}
Now I need to create a table with the row heading as Class and Div
labels :['class','div']
The code i written is not giving actual results,
<el-table :data="array" style="width: 100%">
<el-table-column v-for="label in labels" :key="label"
:prop="label"
:label="label">
</el-table-column>
</el-table>
Note: i am using Element Ui Table -https://element.eleme.io/#/en-US/component/table
I need to have a table like this
But the table I got is
Please help me to loop through inner subDiv and create the table. code box -https://codesandbox.io/s/vigilant-wildflower-zgiq2?file=/src/App.vue

