Aymkdn / v-snackbars

Display the `v-snackbar` (from Vuetify) with a stack display

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Close function passed to slot should always close the message it's for

mwgamble opened this issue · comments

Instead of relying on the correct message ID being passed back to the component by the close() function, the close() function should just automatically use the correct ID.

Essentially, I would just change this line:

https://github.com/Aymkdn/v-snackbars/blob/master/v-snackbars.vue#L22

:close="key => removeMessage(key, true)"

to this:

:close="() => removeMessage(snackbar.key, true)"

Thoughts?

Mmmhhh… I don't remember why I did it this way. But, yes, it would make sense. I'll update the doc and the code when I have a moment.

Done. Thanks for the suggestion.