From 6e8cd885aa59ec1a5d101b529da01a8757fa0f62 Mon Sep 17 00:00:00 2001 From: Simone Gotti Date: Fri, 29 Mar 2019 18:21:57 +0100 Subject: [PATCH] user: do like project on route changes --- src/views/User.vue | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/views/User.vue b/src/views/User.vue index e262b61..6928c5c 100644 --- a/src/views/User.vue +++ b/src/views/User.vue @@ -78,15 +78,12 @@ export default { run: null }; }, - async beforeRouteEnter(to, from, next) { - if (!to.params.runid) next(); - let run = await fetchRun(to.params.runid); - next(vm => (vm.run = run)); - }, - async beforeRouteUpdate(to, from, next) { - if (!to.params.runid) next(); - this.run = await fetchRun(to.params.runid); - next(); + watch: { + $route: async function(route) { + if (route.params.runid) { + this.run = await fetchRun(route.params.runid); + } + } }, methods: { ownerLink: ownerLink,