@byloth/nuxt-vuert-module
Version:
The headless alerts, modals, notifications & popups module for Nuxt.js craftsmen. ℹ
19 lines (14 loc) • 508 B
text/typescript
import { defineNuxtPlugin } from "#app";
import { createVuert, useVuert } from "@byloth/vuert";
import type { VuertOptions } from "@byloth/vuert";
// https://nuxt.com/docs/guide/directory-structure/plugins#creating-plugins
//
export default defineNuxtPlugin({
name: "vuert",
setup: (nuxtApp) =>
{
const options: Partial<VuertOptions> = nuxtApp.$config.public.vuert || { };
nuxtApp.vueApp.use(createVuert(options));
return { provide: { vuert: useVuert() } };
}
});