How to generate headers automatically? Cannot read properties of undefined (reading 'aDataSort').
How to generate headers automatically? Cannot read properties of undefined (reading 'aDataSort').
I am making an application with Vue 3 and I am generating DataTables automatically from a JSON. I managed to insert the table information but I can't get the column titles to be generated automatically. But I get the error: Cannot read properties of undefined (reading 'aDataSort').
And I don't know how to fix it. Any idea? This is my code:
<template>
<DataTable :data="data" :columns="tableColumns" :options="tableOptions" class="display">
<thead>
<tr>
<th v-for="header in headers" :key="header">{{ header }}</th>
</tr>
</thead>
</DataTable>
</template>