[Vuejs]-VueJS @click pass data

0👍

Call a single method on click that calls both methods:

<GmapPolygon v-for="cabstand in cabstands" :path="cabstand.positions" @click="callBothMethods(cabstand)"/>

methods: {
    callBothMethods(cabstand) {
        this.getCabstandClick();
        this.getCabstandInfos(cabstand);
    }
}

0👍

Ok I finally found the solution: I used $event variable in my method.

<GmapPolygon v-for="cabstand in cabstands" :path="cabstand.positions" @click="getCabstandInfos(cabstand, $event)"/>

Thanks for your help.

Leave a comment