vue routing hook function to refresh the current route

refresh.vue

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

  

use:

this. $ router.replace ( 'above vue page', () => {})

Guess you like

Origin www.cnblogs.com/sxdjy/p/12221193.html
Recommended