-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
PrimeVue ToastService not loading correctly as a plugin in Nuxt3 RC3 #2533
Comments
Workaround: plugins/primevue.js import { defineNuxtPlugin } from "#app";
import PrimeVue from "primevue/config";
import ToastService from "primevue/toastservice";
import Toast from "primevue/toast";
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.use(PrimeVue);
nuxtApp.vueApp.use(ToastService);
nuxtApp.vueApp.component("Toast", Toast);
return {
provide: {
toast: nuxtApp.vueApp.config.globalProperties.$toast
}
}
}); |
Hi, I researched this issue and found a PR related to it in Vue core. It looks like it broke access to globalProperties variables and vnode's instances within those custom directives. For now, you can try defineExpose method in <script> tag. Exp;
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm submitting a ... (check one with "x")
CodeSandbox Case (Bug Reports)
https://codesandbox.io/s/sharp-bush-nch4u5
Current behavior
Not working with Nuxt3 and Vue3 setup syntax:
app.vue
plugins/primevue.js
If i try to use Composition API => $toast is not published
my component:
If i try to use Service provider => No PrimeVue Toast provided!
my component:
What is the motivation / use case for changing the behavior?
Please tell us about your environment:
Vue version: 3 RC3
PrimeVue version: 3.12.6
Browser: [all ]
The text was updated successfully, but these errors were encountered: