Created
June 8, 2021 13:08
-
-
Save lucmarcio/edeb110d4c4cbc22e0cc99eff894f839 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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