0

Someone can help me to create a global click function for my custom component dropdown.vue
This is the template:

<div @mouseover="mouse = true" @mouseleave="mouse = false" class="drop-down">
  <slot />
</div>

This is the script:

export default {
  name: 'drop-down',

  data () {
    return {
      mouse: false
    }
  },

  methods: {
    onClickMouse () {
      if (!mouse) {
        this.$parent.showDropDown = false
      }
    }
  }
}

How do I call the function when the user click on any part of the page
Thanks

0 Answers0