directive

Commons
stable

Click-outside handler invoked on each document click event. Calls the bound handler when the last mousedown was outside the element and the binding passes the active check. Internal helper for v-click-outside.

API

Signature

Full TypeScript signature sourced from the util file.

typescript

This is a low-level internal helper. Prefer the v-click-outside directive in application code.

API

Parameters

Input parameters accepted by this util.

e
required
MouseEvent
The click MouseEvent fired on the document.
el
required
HTMLElement
The element the directive is bound to.
binding
required
IClickOutsideDirectiveBinding
The Vue directive binding. Its value is either the handler function or an object { handler, closeConditional }.

API

Return value

The value returned by this util.

Returns nothing. Invokes the bound handler as a side-effect when the outside-click condition is met.

Usage

Examples

Ready-to-paste usage snippets.

Used internally by v-click-outside

typescript