vue-outside-events icon indicating copy to clipboard operation
vue-outside-events copied to clipboard

directives affect whole app

Open Maadtin opened this issue 4 years ago • 3 comments

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!

Maadtin avatar Oct 14 '19 13:10 Maadtin

What do you mean? Anything outside the #app element would, by nature, be outside the button as well, since it contains the button.

nchutchind avatar Oct 14 '19 16:10 nchutchind

@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 avatar Nov 04 '19 18:11 nchutchind

@nchutchind Yes It was my bad, sorry, directive works as expected.

Maadtin avatar Nov 08 '19 09:11 Maadtin