Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

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

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

Last synced: 4 months ago
JSON representation

ClickOutside directive for Vue.

Awesome Lists containing this project

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)