T
T
tyoma_koder2021-06-05 11:06:22
Vue.js
tyoma_koder, 2021-06-05 11:06:22

How to get the element on which the event occurred in VUE?

there is a block with layout inside, an event is attached to this block

<div v-on:click="fs(1, $event)">
<p>123 </p>
<button>666</button>
</div >

when clicking, you need to get exactly this block and not its children

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Belyaev, 2021-06-05
@tyoma_koder

https://developer.mozilla.org/ru/docs/Web/API/Even...
$event in Vue just throws the native event object

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question