在页面的watch中,监听$router的变化

watch: {
    $route (to, from) {
      this.$router.go(0)
    }
  }

其中this.$router.go(0)为刷新页面,但此方法可能在Safari中无法实现,还可以用js原生的方法:window.location.reload()

转载于:https://www.cnblogs.com/jane2160/p/11573315.html

Logo

Vue社区为您提供最前沿的新闻资讯和知识内容

更多推荐