const chatTimer = setInterval(() => { console.log(chatTimer); this.chatMsg(); }, 1000);
this.$once('hook:beforeDestroy', () => { clearInterval(chatTimer); })
const chatTimer = setInterval(() => { console.log(chatTimer); this.chatMsg(); }, 1000);
this.$once('hook:beforeDestroy', () => { clearInterval(chatTimer); })
本文转载自:https://www.cnblogs.com/mybilibili/p/10542193.html