R
R
Roman Rakzin2017-02-28 19:48:29
Vue.js
Roman Rakzin, 2017-02-28 19:48:29

How to run a specific function when refreshing a router vue.js 2.0 page?

How to find out the path of the vue.js router when loading the page and execute the parameters?
Example. There is a link site/users/:UserId
When you select a user, his data is loaded. But if I update, I can’t tie up the update function at startup.
That is, if the site/users/:UserId route is selected and the page has started, then you need to make a request to the server, and not only when you click on this link.
How to implement this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Artem, 2017-02-28
@TwoRS

https://router.vuejs.org/en/advanced/data-fetching.html
It is written in detail here, even with an example.
Don't forget about the created event.

D
Dmitry Belyaev, 2017-02-28
@bingo347

https://router.vuejs.org/en/essentials/navigation.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question