onclick-outside
onclick-outside
Trigger function when clicking outside a component for Vue.js
Vue 2.0 compatible, see demo: https://egoistian.com/onclick-outside
Install
$ npm install --save onclick-outside
Usage
<template>
<click-outside :handler="handleClickOutside">
<button>don't click me, click outside!</button>
</click-outside>
</template>
<script>
import ClickOutside from 'onclick-outside'
export default {
methods: {
handleClickOutside(e) {
console.log('hey, why did you touch outside?')
}
},
components: {
ClickOutside
}
}
</script>
License
MIT © EGOIST
Related Packages
focus-outside
📦 A good clickOutside library, and it solves the problem that iframe cannot tri...
9,573
93
clickout-lite
A lightweight utility to detect outside clicks on elements — compatible with Vue...
3,246
0
Version History
| Version | Released | License |
|---|---|---|
| 0.1.1 | MIT | |
| 0.1.0 | MIT |