🖖 Responsive Touch Compatible Toast plugin for VueJS 2+
2.21k
stars
194
forks
source link
Fixes error which is manipulating the existing object.className Array resulting in wrong css properties of toast in nuxt #195
Closed
simonneutert closed 1 year ago
version "@nuxtjs/toast": "^3.3.1",
cannot tell whether the problem exists in plain vue.js, too, but in nuxt the error can be reproduced by:
toast.success("test", { duration: 3000 })
toast.error("error test", { duration: 3000 })
toast.success("test", { duration: 3000 })
it will appear as an error toast 🟥Looking at the source code, I assume it happened because of an array shallow copy bug.
https://github.com/shakee93/vue-toasted/blob/db5ccc47b9b7b27f097dde0943d67f4269c6be0d/src/js/show.js#L79
When String was used,
options.className
was reassigned to a new Array, but underlying options.className had items pushed to it, modifying in place.