var timer = setInterval(() => { console.log('hahaha'); }, 5000); this.$once('hook:beforeDestroy',() => { clearInterval(timer ) timer = null; })