-
-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How use with Nuxt 3? #232
Comments
Facing same issue |
Same issue with Vue 3. I think it will not work with Vue 3. |
import VueToasted from "vue-toasted";
export default defineNuxtPlugin((nuxtApp) => {
// necessary to make it work with Vue 3 and Nuxt 3
const prevPrototype = nuxtApp.vueApp.prototype;
nuxtApp.vueApp.prototype = {};
nuxtApp.vueApp.use(VueToasted, {
/* options */
});
Object.assign(
nuxtApp.vueApp.config.globalProperties,
nuxtApp.vueApp.prototype
);
nuxtApp.vueApp.prototype = prevPrototype;
}); |
Thanks, that finally worked. For those who don't get what's going on, that's a source code of a plugin. To call a toast from a component or a page:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I try add vue-toasted in Nuxt 3:
But I have error in console:
How it's right to do?
I know about @nuxtjs/toast but it doesn't work with Nuxt 3.
The text was updated successfully, but these errors were encountered: