• Returns the inner value if the argument is a ref, otherwise return the argument itself. This is a sugar function for val = isRef(val) ? val.value : val.

    Type Parameters

    • T

    Parameters

    Returns T

    Example

    function useFoo(x: number | Ref<number>) {
    const unwrapped = unref(x)
    // unwrapped is guaranteed to be number now
    }

    See

    https://vuejs.org/api/reactivity-utilities.html#unref

Generated using TypeDoc