Each row contains a delete button, and I am trying to retrieve the log_id
from the items in order to pass it to the deleteLog
function. However, when I do so, the function always alerts that the log_id
is undefined
.
Is there a way for me to successfully pass the log_id
to the deleteLog
function without encountering the issue of it being undefined
?
<template>
<b-table striped hover :items="items" :fields="fields">
<template v-slot:cell(Delete)>
<b-button variant="danger" v-on:click="deleteLog(log_id)">Delete</b-button>
</template>
</b-table>
</template>
<script>
export default {
data() {
return {
fields: ['Year', 'Month', 'Round', 'Name', 'Delete', 'log_id'],
items: []
}
}
}
</script>