@manusanchev/vue3-clickaway

Vue 3 directive to detect clickaway events
16,020
Install
npm install @manusanchev/vue3-clickaway
Latest Version:1.1.4
Vue:3
License:MIT
Last Updated:Oct 30, 2023
Links: npm
Maintainer: manusanchev

vue3 ClickAway

Vue 3 directive to detect clickaway events

Install

PNPM

pnpm add @manusanchev/vue3-clickaway

Yarn

yarn install @manusanchev/vue3-clickaway

NPM

npm install @manusanchev/vue3-clickaway

Register

Vue 3

import { createApp } from "vue";
import ClickAway from "@manusanchev/vue3-clickaway";
import App from "./App.vue";

const app = createApp(App);
app.use(ClickAway);
app.mount("#app");

Nuxt 3

plugins/clickaway.client.ts

import ClickAway from "@manusanchev/vue3-clickaway";

export default defineNuxtPlugin(nuxtApp => {
  nuxtApp.vueApp.use(ClickAway);
});

Usage

<script setup lang="ts">

function onClickAway() {
  // your code here
}
</script>

<template>
  <div v-clickaway="onClickAway">
    <!-- Content -->
  </div>
</template>

Related Packages

vue3-highlight-text

a vue3 directive of highlight text

84,789
vue-proportion-directive

vue 固定元素比例指令

6,003 10
nuxt-inline-scripts

Enable/Disable inlineScripts for Nuxt3

2,068 1
@eduvia-app/nuxt-can

Nuxt directives (`v-can`, `v-cannot`) to layer permissions without touching busi...

1,214 0
ardirectives

Ardirectives

811

Version History

Version Released Vue License
1.1.4 ^3.x.x MIT
1.1.3 ^3.x.x MIT
1.1.2 ^3.x.x MIT
1.1.1 ^3.x.x MIT
1.1.0 ^3.x.x MIT