flattenFragments

Commons
stable

Recursively unwrap Vue Fragment nodes from a VNode array, returning a flat list of concrete VNodes with no Fragment wrappers.

API

Signature

Full TypeScript signature sourced from the util file.

typescript

API

Parameters

Input parameters accepted by this util.

nodes
required
Array<VNode>
The VNode array to flatten. Fragment children are recursively expanded in place.

API

Return value

The value returned by this util.

A flat array of concrete VNodes — no Fragment nodes remain at any level.

Usage

Examples

Ready-to-paste usage snippets.

Flatten default slot VNodes

typescript