Skip to content

Tabs element not properly unmounting #1028

Answered by romansp
lea0o0oo asked this question in Q&A
Discussion options

You must be logged in to vote

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

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by lea0o0oo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants