Skip to content

🔲 Vue directive to react on clicks outside an element without stopping the event propagation

License

Notifications You must be signed in to change notification settings

dongzhiheng/v-click-outside

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

🔲 Vue directive to react on clicks outside an element without stopping the event propagation

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%