vue 路由钩子函数 刷新当前路由

refresh.vue

export default {
  beforeRouteEnter (to, from, next) {
    this.$nextTick(() => {
      next(vm => {
        vm.$router.replace(from.path)
      })
    })
  }
}

  

使用:

this.$router.replace('上面的vue页面', () => {})
posted @ 2020-01-21 11:37  玛卡巴鉲  阅读(1258)  评论(0编辑  收藏  举报