V
V
Vitaly B2020-08-13 14:56:16
Vue.js
Vitaly B, 2020-08-13 14:56:16

How to attach @click to a list element? If the list is a dynamics received on js?

There is a list of elements. Elements are received through Ajax on pure js. On a click on an element, I get the id of the entry from the attributes of the list element, then a modal window opens and, through a request for id, the content is displayed in it. The window has a vue component in which you need to load data also by the id of the list element.
How can I call a vue method on click on a list element from js and pass the id (id or data-id attribute) of this element to it?
Well, of course, but I really wanted to try out vue on existing tasks.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly B, 2020-08-13
@vitaliy_balahnin

answer found, this example helped: https://jsfiddle.net/vitos8686/5sy3bf1r/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question