JSPM

  • Created
  • Published
  • Downloads 125412
  • Score
    100M100P100Q162342F
  • License ISC

Vue directive to react on clicks outside the current element

Package Exports

  • v-click-outside

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (v-click-outside) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

v-click-outside

Codacy Badge bitHound Overall Score bitHound Dependencies bitHound Dev Dependencies bitHound Code JavaScript Style Guide

Vue directive to react on clicks outside of an element. Great for closing dialogues, drawers 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 {
    name: 'Component',

    methods: {
      onClickOutside () {
        console.log('Clicked...');
      }
    }
  };
</script>

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