Closed autorunman22 closed 1 year ago
For now as I see it, it won't work because the useSnackbar
needs to be called inside setup
. I'll check more on it.
@craigrileyuk if you could help out...
I've followed the steps from readme and end up with same error: Uncaught Error: No Snackbar provided!
In my case the
Sorry the code that gets highlighted got dropped from message.
<NuxtSnackbar />
@autorunman22
Inside your useToast
composable, try wrapping your main function in an onMounted
a la
onMounted(() => {
snackbar.add({
type,
title,
text,
});
});
I've used the exact same setup as this and it's working in my test app.
I can confirm that its working. Thank you @craigrileyuk
I wrap the snackbar calls to simple composable so that I can reduce boilerplate:
composables/useToast.js
But when I refresh the page, i'm getting this error: