• Vue <script setup> compiler macro for providing props default values when using type-based defineProps declaration.

    Example usage:

    withDefaults(defineProps<{
    size?: number
    labels?: string[]
    }>(), {
    size: 3,
    labels: () => ['default label']
    })

    This is only usable inside <script setup>, is compiled away in the output and should not be actually called at runtime.

    Type Parameters

    • T
    • BKeys extends string | number | symbol
    • Defaults extends InferDefaults<T>

    Parameters

    Returns PropsWithDefaults<T, Defaults, BKeys>