• 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

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

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