[Vuejs]-Vuetify datatable format column with dynamic item-slot

1👍

The key you are trying to use to get the current loop value doesn’t exist in the new created object. That’s why you would be getting the error. You should try evaluating if that key exist in that object before using the .join(', ') method.

Try replacing line codesandbox DataTable.vue line 50:

  <span :key="itm" class="red--text">{{ item[itm] }}</span>

with:

  <span :key="itm" class="red--text">{{ itm in item ? item[itm].join(", ") : ""}}</span>

Leave a comment