Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lucmarcio/edeb110d4c4cbc22e0cc99eff894f839 to your computer and use it in GitHub Desktop.
Save lucmarcio/edeb110d4c4cbc22e0cc99eff894f839 to your computer and use it in GitHub Desktop.
Vue.directive('pl-tooltip', {
params: [
'animation',
'container',
'html',
'placement',
'trigger',
],
bind: function() {
$(this.el).tooltip({
animation: this.params.animation || true,
container: this.params.container || false,
html: this.params.html || false,
placement: this.params.placement || 'top',
title: this.vm.$t(this.expression) || '',
trigger: this.params.trigger || 'hover focus',
});
},
unbind: function() {
$(this.el).tooltip('destroy');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment