get route params in asyncData after router push
问题 I'm trying to get the route params in the asyncData method, it works if I go manually to the route, but if I use router Push method, it doesn't get any params. this is my asynData method: async asyncData(ctx) { const { id } = ctx.app.router.currentRoute.params await ctx.store.dispatch('user/GET_USER', id) return { user: ctx.store.state.user.user } }, and this is how I navigate to the respective page: goToEdit(id) { this.$router.push({ path: `/users/${id}/edit` }) } 回答1: You need to get route