From e3ff6dea20fabfba4c0af5feb78f59fa654446d4 Mon Sep 17 00:00:00 2001 From: JPB Date: Thu, 18 May 2023 10:02:18 +0545 Subject: [PATCH] Update README.md Nuxt 3 Setup Docs Added. --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index 214989f..d22c28e 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,29 @@ $ npm install --save vue-toastification@next ### Plugin registration +#### Nuxt 3 Process +Register plugin inside `plugins/toast.js` directory. +```javascript +// toast.js +import Toast from "vue-toastification"; +import "vue-toastification/dist/index.css"; + +export default defineNuxtPlugin(nuxtApp => { + nuxtApp.vueApp.use(Toast, { + hideProgressBar : true + }); + }) +``` +**Transpile** plugin since it is old package to solve issue of **Commonjs** issue +```js +// nuxt.config.js +build:{ + // vue-toastification - old commonjs module + transpile: ['vue-toastification'], + }, +``` +------- +#### Vue Process Add it as a plugin to your app: ```javascript import { createApp } from "vue";