UNPKG

nuxt

Version:

Nuxt is a free and open-source framework with an intuitive and extendable way to create type-safe, performant and production-grade full-stack web applications and websites with Vue.js.

8 lines (7 loc) 231 B
import { onScopeDispose } from "vue"; import { useNuxtApp } from "../nuxt.js"; export function useRuntimeHook(name, fn) { const nuxtApp = useNuxtApp(); const unregister = nuxtApp.hook(name, fn); onScopeDispose(unregister); }