Having issues with rendering array data in Vue Js Element UI using the el-table-column
element. The string data displays correctly, but I'm facing problems with the array data. I've attempted to include static data within the data() return
method, but it's not yielding the desired results. Below is the code snippet showing what I've tried:
HTML
<el-table :data="tableData" style="width: 100%">
<el-table-column prop="module" label="Module">
</el-table-column>
<el-table-column prop="status" label="Status">
</el-table-column>
<el-table-column prop="downloadfiles" label="Download Files"
v-for="(download,index) in tableData[0].downloadfiles[0]">
<el-table-column label="File" :prop="download.file"></el-table-column>
<el-table-column label="Path" :prop="JSON.stringify({download, property:'path'})"></el-table-column>
</el-table-column>
</el-table>
Script
data () {
return {
tableData: [{
"module": 'Order',
"status": "Ok",
"downloadfiles":
[{
"file": "test_20210406080352.zip",
"path": "/opt/var/log/download/"
},
{
"file": "New_20210406080352.zip",
"path": "/opt/var/log/download/"
}]
}],
}
}
I've attempted different approaches to parse the download node data without success. Any insights on how to properly traverse the array object within el-table-column
would be appreciated.