Closed hdwebpros closed 2 months ago
Have you tried passing closeButton: null
to useToast.add()
?
@benjamincanac I'm not using this in the useToast way. Just the straight UNotification
way.
Then, <UNotification :close-button="null" />
?
Wow, that did work! According to https://ui.nuxt.com/components/notification#close I didn't see that we could null
it to disable. Perhaps that should be added to the docs. I'm glad that's fixed!
How to disable close-button
by default using app.config.ts
? because it does not support ui
and neither null
value.
Environment
Build Modules: -
Version
v2.18.4
Reproduction
https://stackblitz.com/edit/nuxt-ui-aoidlu?file=app.vue
Description
As of right now, there is no feature to allow disabling notifications on the notifications itself. https://github.com/nuxt/ui/blob/dev/src/runtime/components/overlays/Notification.vue#L90-L93 That prop default is always going to fall back to the global closeButton UI config if you either omit it or pass any falsy looking value (null, false, undefined, etc.) through. And the config itself doesn’t have a way to just say “no render”.
Additional context
No response
Logs
No response