Why is my $emit not transfering my id and working right

i have an id emitted in my component but in the parent component the id is then suddenly undefined. but it is definitely defined. i wonder why the id is suddenly undefined after the emit and is not passed correctly. does anyone there have an answer for me?

here is my code:

productTile:

 <div >
    <h3>{{name}}</h3>
    <tile-header></tile-header>
    <tile-body :infos="infos" :price="price"></tile-body>
    <button @click="select()">Tarif auswählen</button>
</div>
`,
data() {
    return {
    }
},
props: {
    name: "",
    id: null,
    isSelected: false,
    price: 0,
    infos: []
},
methods: {
    select() {
        this.$emit("product-selected", this.id);
    }
}

productGroup:

   <div >
     <h2>{{groupId}}</h2>
     <product-tile v-for="product in products" :key="product.SKU"
     :name="product.Name" 
     :price="product.Preis"
     :isSelected="product.AuswahlStatus"
     :infos="product.USPs" 
     :id="product.SKU" @product-selected="updateGroup()"></product-tile>
 </div>
 `,
data() {
    return {

    }
},
props: {
    groupId: "",
    products: []
},
methods: {
    updateGroup(productId) {
        if (productId === undefined) {
            console.warn("Produkt ID is undefined");
        } else {

            console.warn("Produkt ID is defined-> ", productId);
            this.$emit("update-group", productId, this.groupId)
        }

    }
}
Updated 2022-01-14 13:20:43Z by Lenjah
@product-selected="updateGroup(product.SKU)"

you need't to pass id with $emit 'cause you have it in the for loop

Updated 2022-01-14 13:26:53Z by Денис Бочков