[Vuejs]-Is it possible to Pass $event from cshtml into Vue.component?

0πŸ‘

βœ…

    <a v-on:click="EditSiteAsset(asset, $event)">
        <i class="mdi mdi-pencil-circle mdi-24px"></i>
    </a>

$event is not "prop" in classic Vue terminology, its just special keyword you can use to pass DOM event when setting up inline DOM event listener

…also, you can remove following code from your event handler

event.preventDefault();
event.stopPropagation();

if you use event modifiers like this:

    <a v-on:click.prevent.stop="EditSiteAsset(asset, $event)">
        <i class="mdi mdi-pencil-circle mdi-24px"></i>
    </a>

Leave a comment