Is there a way to only import the directive?
LeCoupa opened this issue · 2 comments
LeCoupa commented
@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.
Dafrok commented
nice point
LeCoupa commented
Closing the issue as it is now working! 👍