UNPKG

bootstrap-vue

Version:

BootstrapVue provides one of the most comprehensive implementations of Bootstrap 4 components and grid system for Vue.js and with extensive and automated WAI-ARIA accessibility markup.

22 lines (21 loc) 510 B
export default { mounted () { if (typeof document !== 'undefined') { document.documentElement.addEventListener('click', this._clickOutListener) } }, beforeDestroy () { if (typeof document !== 'undefined') { document.documentElement.removeEventListener('click', this._clickOutListener) } }, methods: { _clickOutListener (e) { if (!this.$el.contains(e.target)) { if (this.clickOutListener) { this.clickOutListener() } } } } }