2025-09-05 14:59:21 +08:00

8 lines
231 B
JavaScript

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);
}