UNPKG

reka-ui

Version:

Vue port for Radix UI Primitives.

11 lines (9 loc) 345 B
import type { Ref } from 'vue' import { computed, ref } from 'vue' import { injectConfigProviderContext } from '@/ConfigProvider/ConfigProvider.vue' export function useNonce(nonce?: Ref<string | undefined>) { const context = injectConfigProviderContext({ nonce: ref(), }) return computed(() => nonce?.value || context.nonce?.value) }