Click button propagation

hi,
i have 2 childs component and a parent:

first child1 component:

{{ text }}

i put this in anoher child component “panelGrid”:

<v-button id=“butAdd” v-show=“showAddButton” icon=“fas fa-plus” @click=“addRecord” />
addRecord(e) {
this.$emit(“addRecord”, e);
},

and in my parent i call this addRecord:

<v-panel-grid :title=“lang.trans(‘operatore.list_strutture’)” :grid-istance=“istanceGrid” @addRecord=“addRecord”>

addRecord(e) {
alert(“1”);

    },

when I call the function “addRecord” from paretn alert it is shown to me 2 times.

how can i stop the propagation?

br
Max

Hi @maxdiable
I have created a project using your code, it does not show alert msg 2 times for me on button click. Please have a look : smoosh-resonance-qx2yfz - CodeSandbox
I hope this helps.

hi,
i found the solution:

br
Max :slight_smile:

1 Like