Skip to content

vnode-util

Helper functions for working with Vue 3 VNodes

Smoothing over the edge cases for working with the VNodes returned by a slot

vnode-util

Fragment-aware iteration

Walk slot VNodes without worrying about fragments created by v-for.

Add props

Add extra props, CSS classes, events and refs to slot contents.

Edit the VNode tree

Remove existing nodes, wrap them with other nodes, or insert new nodes into the VNode tree.

Small and tree-shakable

The library is already small, but the helpers are also highly tree-shakable, reducing the size even further.

Type safe

A fully typed API, building on the core Vue types.

Probably not a good idea

But if you really have to manipulate VNodes, a library to smooth over the edge cases makes it less likely to go wrong.

Released under the MIT License.