Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/vue-bulma/click-outside

ClickOutside directive for Vue.
https://github.com/vue-bulma/click-outside

Last synced: 24 days ago
JSON representation

ClickOutside directive for Vue.

Lists

README

        

# ClickOutside

Vue click outside directive.

## Installation

```
$ npm install vue-click-outside
```

## Example

```vue


Toggle

Popup item

import ClickOutside from 'vue-click-outside'

export default {
data () {
return {
opened: false
}
},

methods: {
toggle () {
this.opened = true
},

hide () {
this.opened = false
}
},

mounted () {
// prevent click outside event with popupItem.
this.popupItem = this.$el
},

// do not forget this section
directives: {
ClickOutside
}
}

```

## Badges

![](https://img.shields.io/badge/license-MIT-blue.svg)
![](https://img.shields.io/badge/status-stable-green.svg)

---

> [fundon.me](https://fundon.me)  · 
> GitHub [@fundon](https://github.com/fundon)  · 
> Twitter [@_fundon](https://twitter.com/_fundon)