Detect click outside element
There is the solution I used, which is based on Linus Borg answer and works fine with vue.js 2.0. Vue.directive(‘click-outside’, { bind: function (el, binding, vnode) { el.clickOutsideEvent = function (event) { // here I check that click was outside the el and his children if (!(el == event.target || el.contains(event.target))) { // and if … Read more