vue刷新當前路由

如圖刷新右邊

1.添加刷新方法,

export function refresh(that) {
  that.$router.replace({
    path: '/refresh',
    query: {}
  })
}

 

 

2.調用

            let that = this
             setTimeout(() => {
               refresh(that)
            },2000)

3.添加空白頁

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

我現在牙疼,就簡單寫一下,具體有問題的可以直接問我

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章