The timer is used in the vue project, but the timer is still running when switching pages

Destroyed can be used  when the component leaves the destruction, clear the timer

destroyed: function () {
  clearInterval(xxx)
}

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324983080&siteId=291194637