Vue 刷新当前页面
1). location方式 location.reload() 2). router方式 this.$router.go(0) 3). provide/inject方式 App.vue <script> export default { name: 'App', // 提供reload方法 provide: function () { return { reload: this.reload } }, // isRouterAlive控制显示 data: function () { return { isRouterAlive: true } }, methods: { // 刷新方法 reload: function () { this.isRouterAlive = false; // 该方法会在dom更新后执行 this.$nextTick(function () { this.isRouterAlive = true }) } } } </script> home.vue <script> export default { name: 'h...