vue2-click-outside
Vue directive to react on clicks outside an element without stopping the event propagation.
Install
$ npm install --save vue2-click-outside
$ yarn add vue2-click-outside
Use
Vue
<script> { clickOutsideConfig: handler: thishandler middleware: thismiddleware events: 'dblclick' 'click' active: true } methods: { console } { console } { return eventtargetclassName !== 'modal' } ;</script> <template> <div v-click-outside="onClickOutside"></div> <div v-click-outside="clickOutsideConfig"></div></template>
Or use it as a directive
<script> directives: clickOutside: Vue2ClickOutsidedirective methods: { console } ;</script> <template> <div v-click-outside="onClickOutside"></div></template>
License
MIT