vue 監聽路由進入離開


// 路由離開生命周期函數
  beforeRouteLeave (to, from, next) {
      // 即將跳轉的路由地址
      if (to.path == '/') {
          next();
      }
  },
  // 路由進入生命周期函數
  beforeRouteEnter (to, from, next) {
    // from 上一個頁面路由地址
    // next 放行
    if (from.name == 'fmHome') {
        next();
    };
  }

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM