Let's say I have my project done using Vue.JS. I have a lot of HTML using components of Vue.JS and so on... My forms, inputs, buttons... lots of things have their title
attribute... Now I wish to make those titles look a bit more fancy. In jQuery it is pretty easy to make a small lib (and there are tons of them) to do this without touching existing html. How would it be done "the vue way"?
[EDIT - more examples]
- Imagine I wish to add github.com/Akryum/v-tooltip directive, but don't wish to refactor all my code and include v-tooltip attribute to all my html (call it lazyness). So I'd like to do something like
$('a[title]').each(function(){ $(this).attr('v-title', $(this).attr('title')); });
to automatically apply v-title directive to all my links with title attribute.... I understand I may do this BEFORE initializing Vue.js using jQuery or vanilla js but that's kind of silly. - Imagine I use Vuetify and for debugging purpose I wish all my v-btn components to put something to console.log when clicked. In jQuery it is as easy as
$('.mybutton').click(function(){ console.log($(this).data() ); });
- I wish to show in title/tooltip current value of each input. But again - without need to refactor all my code because maybe I just need it as a temporary measure or A/B test of user experience and it will be removed next day/week... as some pseudocode this would look like
$('input').prop(':title', 'The value is {{model.value}}');