/** * Apply default value to a ref. */ export function useDefault(defaultValue: T): Ref { const source: Ref = ref() return computed({ get() { return source.value ?? defaultValue }, set(value) { source.value = value }, }) }