[Vuejs]-Problem going from one profile/:id to another using Vue js Dynamic Route Matching

0👍

Looks like a simple syntax issue… I’ll admit I’m firing from the hip without testing, but I think it should be something more like this:

<router-link :to="{name: 'app-user-view', params: { userId: $route.params.userId + 1 }}">Next User</router-link>

Assuming that works though, you might want to create a computed property to make those objects for you and get them out of the markup (template) It will make everything a little cleaner.
Also consider safety measures like stopping at 0, dealing with ‘gaps’ from deleted users, etc…

Leave a comment