0👍
You have two ways for load data for certain id
:
1. You can use beforeRouteEnter()
hook (and beforeRouteUpdate()
).
2. You can load data in created()
hook.
In the first case user waiting for while data will load, in the second case user can see page with default data and after load your real data user will see rerender parts of page.
General information is in Vue route Data fetching documentation.
Source:stackexchange.com