[Vuejs]-My three.js canvas get duplicated when I change my view with router in vue.js

0👍

Well in your HelloThree component mounted hook you are appending new node into the DOM by hand (document.body.appendChild(this.renderer.domElement)) so it’s your responsibility to remove it when the component is destroyed. Appropriate place would be for example beforeDestroy hook

Also check whether THREE library needs some cleanup or you will create memory leak in your app

Leave a comment