Dafrok/v-hotkey

Is there a way to only import the directive?

LeCoupa opened this issue · 2 comments

@Dafrok Is there a way to only import the directive?

I am thinking about something like this:

import vClickOutside from 'v-click-outside'

<script>
  export default {
    directives: {
      clickOutside: vClickOutside.directive
    },
    methods: {
      onClickOutside (event) {
        console.log('Clicked outside. Event: ', event)
      }
    }
  };
</script>

<template>
  <div v-click-outside="onClickOutside"></div>
</template>

I can submit a PR if this is not the case.

nice point

Closing the issue as it is now working! 👍