diff --git a/index.js b/index.js index 986fbc4..1a22b7b 100644 --- a/index.js +++ b/index.js @@ -53,7 +53,7 @@ exports = module.exports = { handler: handler, callback: binding.value } - !isServer(vNode) && document.addEventListener('click', handler) + !isServer(vNode) && document.addEventListener('click', handler, true) }, update: function (el, binding) { @@ -62,7 +62,7 @@ exports = module.exports = { unbind: function (el, binding, vNode) { // Remove Event Listeners - !isServer(vNode) && document.removeEventListener('click', el.__vueClickOutside__.handler) + !isServer(vNode) && document.removeEventListener('click', el.__vueClickOutside__.handler, true) delete el.__vueClickOutside__ } }