I need to pass data attributes to a root method using @click, I try e.target to get data on click but it does not work I get undefined.
I wonder if It is possible to pass custom data attributes to a root method?
example:
any-page-sample.html
I call root method using $app.methods.helloWorld() and not problem with that but it is not possible get the data attributes! I get undefined!
<a href="#" data-id="123" @click="$app.methods.helloWorld()">$root.helloWorld()</a>
in app.js
methods: {
helloWorld: function (e) {
var id = $(e.target).closest("a").data('id');
app.dialog.alert(id);
},
},
for local declared methods at the current page I can get all data attributes but for the root methods is not possible! always getting UNDEFINED…
Is it possible to pass data attributes to root methods?
Appreciate any tip!
Big thanks!