Skip to content
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

[Bug Report][3.7.0] I can't define default slot when adding an item to SnackbarQueue #20384

Open
etienne-monier opened this issue Aug 23, 2024 · 6 comments

Comments

@etienne-monier
Copy link

Environment

Vuetify Version: 3.7.0
Vue Version: 3.4.27
Browsers: Chrome 125.0.0.0
OS: Linux x86_64

Steps to reproduce

Push a notification to snackbar queue with "v-slot:default" prop.

Expected Behavior

The text/node in "v-slot:default" prop renders in the snackbar.

Actual Behavior

The snackbar is empty

Reproduction Link

https://play.vuetifyjs.com/#...

Other comments

This prop appears in the API.

@etienne-monier
Copy link
Author

Oh, that's just a documentation mistake. So, what's the correct usage? It seems a callable returning a node is expected.

@KaelWD
Copy link
Member

KaelWD commented Aug 25, 2024

The prop doesn't actually exist, it's in the docs because items is typed as VSnackbar['$props'][] and slots are added to prop types for JSX but are only valid directly on a JSX element not in a props object.

@etienne-monier
Copy link
Author

Oh! So that's impossible to add complex snackbars (mine has a title with icon and a text) to the queue. We must use props only and so simple snackbars with text only. That's it?

@KaelWD
Copy link
Member

KaelWD commented Aug 26, 2024

Yes, SnackbarQueue itself has some slots though.

@etienne-monier
Copy link
Author

Ok, I found out how to do that. Here is an example.

My last issue: How to make a closable button? Using classic snackbar, I can use the snackbar model as in this example. I tried to shift the model array in the above playground, but this does not seems to work...

@jumptrnr
Copy link

jumptrnr commented Sep 11, 2024

Ok, I found out how to do that. Here is an example.

My last issue: How to make a closable button? Using classic snackbar, I can use the snackbar model as in this example. I tried to shift the model array in the above playground, but this does not seems to work...

any luck on this?

--- EDIT: in case anyone else needs this...

<v-snackbar-queue closable="true" close-text="Close" v-model="notificationQueue">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants