[Vuejs]-How do I display data on detailpage in vue?

0👍

Well, you are passing an ID (most probably an INT) not an object.

 params: { beerId: beer.id }

so you can access an integer (the ID), that has no properties.
If you want to access all the properties, you should pass and object

 params: {beerId: beer.id, beer: beer }

Passing the ID only, make sense if you are loading the specific beer details in a second request, eg when the beer page is mounted

Leave a comment