this post was submitted on 11 Sep 2023
1 points (100.0% liked)

Vue.js

446 readers
1 users here now

founded 1 year ago
MODERATORS
 

I haven't found a good way to do this. Basically the props that you can pass as params, end up getting displayed in the url as resource or queries.

The above code makes the url look like "url/id/1"

What if i want to pass multiple props like "id" and " name" through router-link but don't want the url to have the "name" field?

Hopefully, someone can answer this. Thank you.

you are viewing a single comment's thread
view the rest of the comments
[–] Reinsch@feddit.de 0 points 1 year ago* (last edited 1 year ago)

Yep, definitely a job for pinia. But a second fetch doesn't seem unreasonable as well. The "list page" fetches an API endpoint to get a basic list of users, the "detail page" fetches another API endpoint returning a single user with the detailed information. If you are worried if you are doing to much requests, you also may have a look on Nuxt. With the SSR functionality it will save you multiple requests made.