Created
February 8, 2018 13:13
-
-
Save jesslilly/e6ccf70736bc1a8ae9abe5afc212c1de to your computer and use it in GitHub Desktop.
Vue Directive on show-bs-tab
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('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