# vue-click-outside

> ClickOutside directive for Vue

Latest version **1.1.0** (published 2020-04-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-click-outside
pnpm add vue-click-outside
yarn add vue-click-outside
bun add vue-click-outside
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2020-04-15 |
| First published | 2016-06-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 302 |
| Author | Fangdun Cai |
| Maintainers | fundon, luventa |

## Links

- npm: https://www.npmjs.com/package/vue-click-outside
- Repository: https://github.com/vue-bulma/click-outside
- Homepage: https://github.com/vue-bulma/click-outside#readme
- Issues: https://github.com/vue-bulma/click-outside/issues
- npm.io page: https://npm.io/package/vue-click-outside

## Recent versions

- 1.1.0 (latest) — 2020-04-15
- 1.0.7 — 2017-10-29
- 1.0.6 — 2017-06-02
- 1.0.5 — 2017-04-19
- 1.0.4 — 2017-04-19
- 1.0.3 — 2017-03-06
- 1.0.2 — 2017-03-02
- 1.0.1 — 2017-02-24
- 1.0.0 — 2017-02-24
- 0.4.3 — 2016-07-03
- 0.4.2 — 2016-07-01
- 0.4.1 — 2016-07-01
- 0.4.0 — 2016-07-01
- 0.3.0 — 2016-07-01
- 0.2.1 — 2016-06-22
- … 2 more at https://npm.io/package/vue-click-outside/versions

## README

# ClickOutside

Vue click outside directive.

## Installation

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

## Example

```vue
<template>
  <div>
    <div v-click-outside="hide" @click="toggle">Toggle</div>
    <div v-show="opened">Popup item</div>
  </div>
</template>

<script>
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
  }
}
</script>
```

## Badges

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

---

> [fundon.me](https://fundon.me) &nbsp;&middot;&nbsp;
> GitHub [@fundon](https://github.com/fundon) &nbsp;&middot;&nbsp;
> Twitter [@_fundon](https://twitter.com/_fundon)

---
_Source: https://npm.io/package/vue-click-outside · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
