# v-click-outside
[](https://app.codeship.com/projects/213256)
[](https://coveralls.io/github/ndelvalle/v-click-outside?branch=master)
[](https://david-dm.org/ndelvalle/v-click-outside)
[](https://david-dm.org/ndelvalle/v-click-outside?type=dev)
[](https://www.codacy.com/app/ndelvalle/v-click-outside?utm_source=github.com&utm_medium=referral&utm_content=ndelvalle/v-click-outside&utm_campaign=Badge_Grade)
[](https://github.com/prettier/prettier)
Vue directive to react on clicks outside an element without stopping the event propagation. Great for closing dialogues, menus among other things.
## Install
```bash
$ npm install --save v-click-outside
```
```bash
$ yarn add v-click-outside
```
## Use
```js
import Vue from 'vue'
import vClickOutside from 'v-click-outside'
Vue.use(vClickOutside)
```
```js
```
Or use it as a directive
```js
import vClickOutside from 'v-click-outside'
```
## Example
[](https://codesandbox.io/s/zx7mx8y1ol?module=%2Fsrc%2Fcomponents%2FHelloWorld.vue)
## Migrate from version 1
The `notouch` modifier is not longer supported, same functionality can be achieved using a middleware function
## License
[MIT License](https://github.com/ndelvalle/v-click-outside/blob/master/LICENSE)