• Attach a Hydrateless enhancer to a template ref for the lifetime of the component. This is the one low-level escape hatch in @hydrateless/vue: every component in the package is built on it, and you can use it directly for markup the components don't cover. Returns a shallow ref to the enhancer's imperative API (setValue, setOpen, and so on), null until mounted. The enhancer runs client-side only, so components stay SSR-safe, and is destroyed on unmount. options may be a getter; it's re-read, and the enhancer re-attached, whenever deps changes.

    <script setup>
    import { useTemplateRef } from 'vue';
    import { enhanceTabs } from '@hydrateless/enhancers';
    const host = useTemplateRef('host');
    const api = useEnhancer(host, enhanceTabs, { activation: 'automatic' });
    // api.value?.setValue('two');
    </script>
    <template><div data-hl-tabs ref="host">...</div></template>

    Type Parameters

    • Options extends object
    • Api

    Parameters

    • el: Ref<null | HTMLElement>
    • enhancer: (container: HTMLElement, options?: Partial<Options>) => EnhancerHandle<Api>
    • Optionaloptions: MaybeRefOrGetter<Partial<Options>>
    • Optionaldeps: WatchSource<unknown>

    Returns ShallowRef<null | Api>