I'm new to Vue and have a few questions on it. But I think the issue I am running is the one I have no idea how to solve it:
I have a few <div class="foo">
in my code. I want to interact with these <div>
s using a Vue instance. I had the idea to use something like:
var app = new Vue({
el: 'div.foo',
data: {
message: 'bar'
}
})
Therefore, all the div.foo
elements would be manageable by app
. But how can I get EXACTLY the element I'm working with?
Let's say in JQuery we have this...
$("div.foo").click(function() {
console.log($(this));
})
The code will work for every div.foo
, but the print will show just the clicked element.