You are viewing Pre-Alpha documentation.
Vuetify0 Logo

toReactive

The toReactive utility function converts a MaybeRef object to a reactive proxy, automatically unwrapping ref values. It provides special handling for Map, Set, and regular objects.

Usage

import { ref } from 'vue'
import { toReactive } from '@vuetify/v0'

const state = ref({ name: 'John', age: 30 })
const rstate = toReactive(state)

console.log(rstate.name) // 'John' (no .value needed)

API

ComposableDescription
toArray→Convert value to array
useProxyModel→Two-way binding with transformation

toReactive

  • Type

    function toReactive<Z extends object> (
      objectRef: MaybeRef<Z>
    ): UnwrapNestedRefs<Z>
  • Details

    Converts a MaybeRef to a reactive proxy that automatically unwraps ref values. Provides special handling for:

    • Map: Unwraps ref values when accessing via get(), and updates existing refs when using set()
    • Set: Unwraps ref values during iteration
    • Objects/Arrays: Unwraps nested refs automatically

    Z represents the type of the object being converted.


© 2016-2025 Vuetify, LLC