Vue 3 directive to react on clicks outside an element
npm install click-outside-vue3Vue 3 directive to react on clicks outside an element without stopping the event propagation.
Great for closing dialogues and menus among other things.
bash
$ npm install --save click-outside-vue3
``bash
$ yarn add click-outside-vue3
`Use
`js
import { createApp } from "vue"
import App from "./App.vue"
import vClickOutside from "click-outside-vue3"const app = createApp(App)
app.use(vClickOutside)
``js
`
Or use it as a directive`js
import vClickOutside from 'click-outside-vue3'
`Detecting Iframe Clicks
To our knowledge, there isn't an idiomatic way to detect a click on a