vue-v-clickoutside
v1.0.2
Published
A simple click-outside directive for Vue.js
Downloads
8
Readme
vue-v-clickoutside
A simple click-outside directive for Vue.js
Installation
npm i vue-v-clickoutside
or
yarn add vue-v-clickoutside
Usage
Import
/*global import*/
import ClickOutSide from 'vue-v-clickoutside'
Vue.directive('clickoutside', ClickOutSide)
/*local import*/
import ClickOutSide from 'vue-v-clickoutside'
export default {
...
directives: {
'clickoutside': ClickOutSide
}
...
}
Example
<templete>
<div v-clickoutside="handleFunction"></div>
</templete>
...
export default {
...
methods: {
handleFunction() {
// handler
}
}
...
}