-
I am undecided about the fact if I should open an issue or not, since maybe there is already a solution that I missed, even after doing research. So the problem is that the tab element doesen't unmount properly after switching tab, and instead of re-using the same element it spawns another (while the other one is still mounted). To demonstrate it I made this very quickly: There is a tab element with I hope that I provided a good explanation to this, but please see the stackblitz project to understand it |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It definitely unmounts when tabs switch but you're not clearing your I recommend you revisit lifecycle hooks in vue.js docs: https://vuejs.org/guide/essentials/lifecycle.html Fixed your stacklitz here: https://stackblitz.com/edit/vitejs-vite-qwhhsa?file=src%2FTab1.vue |
Beta Was this translation helpful? Give feedback.
It definitely unmounts when tabs switch but you're not clearing your
setInterval
callback. This has to be done manually, or you can use a composable from VueUse which does it for you automatically.I recommend you revisit lifecycle hooks in vue.js docs: https://vuejs.org/guide/essentials/lifecycle.html
Fixed your stacklitz here: https://stackblitz.com/edit/vitejs-vite-qwhhsa?file=src%2FTab1.vue