Fetching some headers config from a belongsTo()
relation from Laravel. The responses looks like this:
My Vuetify data table config is this one:
<v-data-table
:headers="newHeaders"
:items="products"
item-key="name"
>
<template v-slot:header.stocks.0.pivot.quantity="{ header }">
{{ header.text }}
<v-icon>
mdi-pencil-outline
</v-icon>
</template>
</v-data-table>
I just want to use the slot to add my icon 'dynamically' to all 'Stock' headers adding (Could be 1, 2 3 or more headers).
How can I achieve this feature? I mean, right now is statically because if another stock is added I have to use <template v-slot:header.stocks.1.pivot.quantity="{ header }">
to do it.
Edited: This is how the table looks like: