Skip to content

Latest commit

 

History

History
55 lines (39 loc) · 1.91 KB

README.md

File metadata and controls

55 lines (39 loc) · 1.91 KB

v-click-outside

Codeship Status Coverage Status Codacy Badge bitHound Overall Score bitHound Dev Dependencies bitHound Code

Vue directive to react on clicks outside an element without stopping the event propagation. Great for closing dialogues, menus among other things.

Install

$ npm install --save v-click-outside
$ yarn add v-click-outside

Use

import Vue from 'vue'
import vClickOutside from 'v-click-outside'

Vue.use(vClickOutside)
<script>
  export default {
    methods: {
      onClickOutside (event) {
        console.log('Clicked outside. Event: ', event)
      }
    }
  };
</script>

<template>
  <div v-click-outside="onClickOutside"></div>
</template>

License

MIT License

Style

Standard - JavaScript Style Guide