Just started learning Vue yesterday and I love it. I'm trying to trigger an event when a user clicks on an anchor with a phone number:
var phoneNumbers = new Vue({
el: "a[href^='tel:']",
methods: {
onClick() { console.log('a phone number was clicked'); }
}
})
The issue is, I would like to (in this particular case), not have to add v-on:click="" to the actual element. This is because I'm dealing with a CMS where users may add links to phone numbers where they wouldn't be adding the vue attributes to the markup.
Any way of accomplishing this?
Thanks!