Gathering detailed insights and metrics for vue3-click-away
Gathering detailed insights and metrics for vue3-click-away
Gathering detailed insights and metrics for vue3-click-away
Gathering detailed insights and metrics for vue3-click-away
npm install vue3-click-away
Typescript
Module System
Node Version
NPM Version
99.4
Supply Chain
100
Quality
76
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
109 Stars
48 Commits
12 Forks
3 Watchers
1 Branches
3 Contributors
Updated on Mar 09, 2025
Latest Version
1.2.4
Package Id
vue3-click-away@1.2.4
Unpacked Size
14.37 kB
Size
4.14 kB
File Count
8
NPM Version
7.21.0
Node Version
16.8.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Demo is available using VitePress and is included in this repository. See Demo Section on how to use and the reason why it's not live yet.
Vue 3.0 Compatible Click Away Directive
Detect if a click event happened outside of an element. Compatible with Vue 3.x.
npm i -s vue3-click-away
yarn add vue3-click-away
By default the module exports a plugin, but you can also use this as a mixin which is documented below or as a directive.
1import { createApp } from "vue"; 2import App from "./App.vue"; 3import VueClickAway from "vue3-click-away"; 4 5const app = createApp(App); 6 7app.use(VueClickAway) // Makes 'v-click-away' directive usable in every component 8app.mount('#app')
With Options API
1<template> 2 <div v-click-away="onClickAway"> 3 ... 4 </div> 5</template> 6 7<script> 8export default { 9 methods: { 10 onClickAway(event) { 11 console.log(event) 12 } 13 } 14} 15</script>
or with Vue Composition API & Typescript
1<template> 2 <div v-click-away="onClickAway"> 3 ... 4 </div> 5</template> 6 7<script> 8export default { 9 setup() { 10 const onClickAway = (event) => { 11 console.log(event) 12 } 13 14 return { onClickAway } 15 } 16} 17</script>
1<template> 2 <div v-click-away="onClickAway"> 3 ... 4 </div> 5</template>
1import { directive } from "vue3-click-away"; 2export default { 3 directives: { 4 ClickAway: directive 5 }, 6 methods: { 7 onClickAway(event) { 8 console.log(event); 9 } 10 } 11}
1<template> 2 <div v-click-away="onClickAway"> 3 ... 4 </div> 5</template>
1import { mixin as VueClickAway } from "vue3-click-away"; 2export default { 3 mixins: [VueClickAway], 4 methods: { 5 onClickAway(event) { 6 console.log(event); 7 } 8 } 9}
Currently VitePress is having an issue building for production since Directives require SSR implementation and there is no way to override this or skip it (VuePress has ClientOnly component, VitePress doesn't, Yet).
I've opened an issue and pending to see if there is a way to go around it, Click Here to view the issue reported.
For the time being, to test this out clone the repository and run the following inside the /docs
folder
npx vitepress
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 2/20 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
56 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More