After entering the home page, jump to the new page via the vue route, and then after clicking the home page to return, the js code of the home page is not executed.

JS Code

window.$("document").ready(() => {
// 
  const windowHeight = document.documentElement.clientHeight
  const menuListHeight = windowHeight - 80 + "px"
  const contentListHeight = windowHeight - 101 + "px"
  window.$(".workbenchdiv1").css("height", menuListHeight)
  window.$(".workbenchdiv2").css("height", contentListHeight)
  // 
  window.$(".have-list ul:nth-child(1)").on("click", function () {
    window.$(this).siblings().slideToggle()
  })
  // 
  window.$(".no-list").on("click", function () {
  })
})

Mar.07,2021
The

ready event, which enters the page for the first time, triggers when the document is loaded. And then it won't be triggered again.
if you want to execute this code every time you enter the front page, that is, execute this code every time you enter the route, just OK it in the mounted hook function.

Menu