vue-router退出登录清空路由 router没有提供清空数据的方法。我们可以这样写 this.$router.replace({path: '/login'});location.reload();