If you got in trouble, to use native javascript onclick
then use the following snippet.
<div wire:click="action" onclick="confirm('Are you sure you want to do this?') || event.stopImmediatePropagation()" class="btn btn-sm btn-success"
>
{{trans('global.add')}}
</div>
Above the example shows the following:
- div calls the components
action
method - after click, alert window pop-up and works like a charm!
Finally again:
onclick="confirm('Are you sure you want to do this?') || event.stopImmediatePropagation()"
Have a nice day!