1.监听路由处理

watch: {
    $route(to, from) {
      // 逻辑
// 重新调用数据接口
} },

2.beforeRouteUpdate导航守卫 路由更新时触发

 beforeRouteUpdate (to, from, next) {
    // 逻辑
    this.$route.query.xx = to.params.xx;

    next()  // 一定要有next
  },

3.只需要在入口文件设置监听事件即可

<div >
 
data() {
   return {
     Key: ''
   };
},
watch: {
   $route: function(newUrl, oldUrl) {
     this.Key = new Date().getTime();
   }
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-25
  • 2019-08-23
  • 2021-10-28
  • 2021-09-20
猜你喜欢
  • 2021-06-16
  • 2021-09-27
  • 2022-12-23
  • 2021-09-30
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案