vue this.$router.push 两次跳转路由,页面不刷新问题

function goRoute(){
	//路由数组
	let visitedViews = this.$store.state.tagsView.visitedViews; 
	for(let i in visitedViews ) {
        // 遍历找到对应路由
        if(visitedViews[i].name === '跳转路由名称'){
          this.$store.dispatch('tagsView/delCachedView', visitedViews[i]).then(() => {
            const { fullPath } = visitedViews[i]
            this.$nextTick(() => {
              this.$router.replace({
                path: '/redirect' + fullPath
              })
            })
          })
        }
      }
}

你可能感兴趣的:(vue.js)