Close function passed to slot should always close the message it's for
mwgamble opened this issue · comments
Matthew Gamble commented
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?
Aymeric commented
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.
Aymeric commented
Done. Thanks for the suggestion.