Skip to content

vClosable

vClosable is a Vue 3 directive to trigger a function when the user clicks outside an element, you can exclude some elements

Basic usage

Click outside from the container

Global install

main.ts

typescript
import { createApp } from 'vue'
import { vClosableInstall } from 'maz-ui'

const app = createApp(App)

app.use(vClosableInstall)

app.mount('#app')

Types

ts
type vClosableBindingValue = (...args: any[]) => any | {
  handler: (...args: any[]) => any
  exclude?: string[]
}