vue-outside-events
vue-outside-events copied to clipboard
directives affect whole app
Hello, just trying this library using a little example like this
<div id="app">
<button v-click-outside="onClickOutside" v-mouseout-outside="onMouseOutOutside">Test</button>
</div>
let app = new Vue({
el: '#app',
data: {
hello: '',
},
methods: {
onMouseOutOutside (e, el, extras) {
console.log('onMouseOutOutside ->', e, el, extras);
},
onClickOutside (e, el, extras) {
console.log('onClickOutside ->', e, el, extras);
},
},
mounted () {
}
})
This code is affecting not only on button but on whole #app element, any idea why? thanks!
What do you mean? Anything outside the #app element would, by nature, be outside the button as well, since it contains the button.
@Maadtin can you verify whether or not this is actually a bug? It sounds like you're describing the basic appropriate behavior of the app.
@nchutchind Yes It was my bad, sorry, directive works as expected.