Skip to content

Instantly share code, notes, and snippets.

@jesslilly
Created February 8, 2018 13:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jesslilly/e6ccf70736bc1a8ae9abe5afc212c1de to your computer and use it in GitHub Desktop.
Save jesslilly/e6ccf70736bc1a8ae9abe5afc212c1de to your computer and use it in GitHub Desktop.
Vue Directive on show-bs-tab
Vue.directive('on-show-bs-tab', {
bind: function (el, binding) {
// This is BS4 jQuery
// When the tab is activated, load the data!
$(el).on('show.bs.tab', function (e) {
if (typeof binding.value === "function") {
binding.value.call();
}
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment