0
点赞
收藏
分享

微信扫一扫

vue跳转后怎么刷新跳转后的页面

  • 使用this.$router.go(0)可以刷新当前页面;
  • 使用this.$router.replace()可以替换当前页面;
  • 使用this.$router.push()可以跳转到新页面;
  • 使用this.$router.push({path: '/xxx', query: {a: 1}})可以跳转到新页面,并传递参数;
  • 使用this.$router.push({name: 'xxx', params: {a: 1}})可以跳转到新页面,并传递参数;
  • 使用this.$router.push({path: '/xxx', query: {a: 1}, replace: true})可以替换当前页面,并传递参数;
  • 使用this.$router.push({name: 'xxx', params: {a: 1}, replace: true})可以替换当前页面,并传递参数;
  • 使用this.$router.go(-1)可以返回上一页;
  • 使用this.$router.go(1)可以前进一页;
  • 使用this.$router.go(-2)可以返回上两页;
  • 使用this.$router.go(2)可以前进两页;
  • 使用this.$router.go(-n)可以返回上n页;
  • 使用this.$router.go(n)可以前进n页;
举报

相关推荐

0 条评论