Get element data attribute

<button @click=“onDelete” data-uid=“102”>

Please, what’s the corrected method of retrieving the data attribute of an element using the ‘@click’ - method function.

if it is a router component file:

onDelete: function (e) {
  var $ = this.$;
  var id = $(e.target).attr('data-uid');
  ...
}
3 Likes

Thanks so much. This solved it.