Skip to content

useMaska

Overview

Applies a maska input mask to an element ref with reactive options. When called inside a component setup, initializes on mount and cleans up on unmount. When called outside a component context, initializes immediately. Cleanup is tied to the enclosing effect scope via tryOnScopeDispose, so it works in components, watchEffect, and manual effectScope contexts. The destroy() method is also exposed for early teardown and is idempotent.

Signature

useMaska(target, options)

Parameters

NameTypeRequiredDescription
targetRefyesA template ref pointing to an input element or component with an input $el.
optionsMaybeRefOrGetteryesMask configuration object. May be a ref or getter for reactive updates.

Returns

UseMaskaReturn

Source

client/lib/use/useMaska.js:43

Documents matching: server v3.0.0a1.post1client v3.0.0-alpha.2