-1

May I know how to properly access and concatenate my data in vue-good-table? Data is not appearing in the table.

Here's my code:

<vue-good-table
   :columns="columns"
   :rows="bigDataInformationList"
>

  <template v-slot:rows="data">
    <td>{{data.row.dataLocationSet.dataLocCity}}</td>
    <td>{{data.row.dataProfileSet.dataProfileLastName}}</td>
    <td>{{data.row.dataServicesSet[0].dataService1 ? "Yes" : "No"}}</td>
  </template>
</vue-good-table>

columns: [
{
label: 'Data City Located',
field: 'dataLocCity', -->not appearing in the table :(
},
{
label: 'Data Profile 01',
field: 'dataProfileLastName', -->not appearing in the table :(
},
{
label: 'Data Service 01',
field: 'dataService1', -->not appearing in the table :(
},
],
jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
Ace Valdez
  • 241
  • 4
  • 8

1 Answers1

0

here : data.row.dataServicesSet[0].dataService1 ? "Yes" : "No"

you should use a function to hold the logic and to return the param that you want

getDataService: function (rowObj) {
  if (rowObj.dataServicesSet[0].dataService1) {
    return 'yes'
  } else {
    return 'no
  }
}

and use it like this : this.getDataService()

abdo
  • 16