0👍
If you’re using Vue Router, you could put a beforeRouteEnter()
route guard in the component. The router will call this whenever the user navigates to the route which displays that component. Alternatively, you could fetch the data in the page components mounted()
method.
Source:stackexchange.com