-
Notifications
You must be signed in to change notification settings - Fork 11
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
Missing composables in global imports #15
Comments
Hi, useToast, useConfirm and usePrimeVue is not a composables. They generate globalProperties for components. For example; $primevue from usePrimeVue Best Regards, |
Hello, That is simply not true, per two definitions of composables. import { inject } from 'vue';
export const PrimeVueToastSymbol = Symbol();
export function useToast() {
const PrimeVueToast = inject(PrimeVueToastSymbol);
if (!PrimeVueToast) {
throw new Error('No PrimeVue Toast provided!');
}
return PrimeVueToast;
} Here's the complete code of If it is not a composable, then it shouldn't be named like so. In any case, composable or not, I think it would benefit the plugin for these functions to be made available globally, like the other symbols. Best regards. |
Hello, I have examined this issue in depth. I noticed that such imports are made as in the 'Explicit Imports' structure. That's why I added all use* structures in the composables file. In order to use your use* structures, you must import as;
Example App;
Best Regards, |
If anyone else comes across this and like me, the suggested fix doesn't work (probably because I don't understand it), the fix over here resolved the issue for me primefaces/primevue#1442 (comment) |
As of v0.1.0 of this module, the only auto-imported composable is
useStyles
(fromprimevue/usestyles
).However, there are other composables that Primevue provides, notably
useToast
(fromprimevue/usetoast
),useConfirm
(fromprimevue/useconfirm
), or evenusePrimeVue
.The text was updated successfully, but these errors were encountered: