Code: Select all
data : [
{id: 123, value:apple}
{id: 353, value:orange}
{id: 393, value:melon}
{id: 456, value:banana}
]
I would want to jump to a unique page with the data's id as the slag value when the PrimeVue Button onclick. ex: www.example.com/post/:id
How can i access the index and pass the corresponding id field to the button's method in order for this to work ?
Code: Select all
<DataTable :value="data" >
<Column field="value" header="Fruit" headerStyle="width:10em;"></Column>
<Column headerStyle="width:4em;" header="" >
<template #body>
<Button @click="methodToJump(#index value of the dataset#)" type="button" icon="pi pi-search" class="p-button-success" style="margin-right: .5em">
</Button>
</template>
</Column>
</DataTable>