filterInputAttrs

Input
stable

Splits a component's $attrs into two groups: attributes that belong on the root element (class, style, id, data-*, bubbling events) and attributes that should be forwarded to the inner <input> element (non-bubbling events + the rest).

API

Signature

Full TypeScript signature sourced from the util file.

typescript

API

Parameters

Input parameters accepted by this util.

attrs
required
Record<string, unknown>
The component attrs object, typically $attrs from a Vue component using inheritAttrs: false.

API

Return value

The value returned by this util.

A tuple of [rootAttrs, inputAttrs]. rootAttrs contains class/style/id/data-* and bubbling event listeners; inputAttrs contains all remaining attributes and non-bubbling event listeners.

Usage

Examples

Ready-to-paste usage snippets.

Split attrs between root and input

typescript