Closed dwightjack closed 8 years ago
Have a look at the examples in vue-router's next
branch:
To fetch data after the new route component has been entered, use this approach:
https://github.com/vuejs/vue-router/blob/next/examples/data-fetching/Post.vue#L31-L36
If you want to hold off with the transition until the data was fetched, use the beforeRouteEnter
hook:
https://github.com/vuejs/vue-router/blob/next/examples/navigation-guards/app.js#L50-L64
Hi thabks for the reply.
So I need to call fect both on created and on route change? Or the route change oa just in place because of the id params?
Or the route change oa just in place because of the id params?
That's correct
Ok thank you again!
For simpler applicaion, i do not want to use vue-router. In such case, how can i use vue-async-data plugin in vuejs2.0 environment?
Hi,
looking at this example for data fetching with vue-router v2+ I understand that the async
data
option has been removed and a pattern for async data very similar to this project is in use.I'm refactoring a vue 1.x project with migration to v2 in mind, so I was wondering if my assumption is true and whether it'd be an option to adapt this plugin to work with 2.x
If so I'd might also be able to take care of the task and make a PR