0👍
v-on:click="select($event, kudo.id)"
If your kudo indeed has an id, then this will work. And you need to modify select to take in said id.
- [Vuejs]-Postman returns success, but browser don't
- [Vuejs]-How to validate Dynamic input in vuejs / Laravel
0👍
Your select
method has to have kudo.id
as parameter.
<template>
<div v-for="kudo in catkudo" style="width:20%;float:left;display:block;height:80px;">
<div class="kudos_img" style="">
<img style="width:40%" :value="kudo.id" @click="select(kudo.id)" v-model="kudocat" :src="'/kudosuploads/badges/'+kudo.image" alt="">
<p>{{ kudo.catname }}</p>
</div>
</div>
</template>
export default {
methods: {
select (id) {
console.log(id, 'is selected');
}
}
}
- [Vuejs]-Vue routing breaks if URL doesn't contain a hash (no input file specified)
- [Vuejs]-Real time vuetify data table not updating with axios
Source:stackexchange.com