G
G
Gjrv2018-07-15 20:49:09
Django
Gjrv, 2018-07-15 20:49:09

How to organize lazy loading in vue.js?

Good day, toasters. Tell me please.
There is a vue.js application that receives some data (in json format) through the rest api.
One of the components is requested at the time of the execution of the "created" hook to receive this data. Each time, switching from another component (via vue routing), a new request occurs, so the component takes a long time to load. I would like to get rid of this.
Please tell me how to correctly solve the problem, maybe use a lightweight request to the server, which will tell if there is new data, or if there are other ways.
Ps api on django rest framework

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2018-07-15
@Gjrv

Never worked with Vue, just had a quick look at the documentation . I suspect that wrapping a component in an element will help youkeep-alive

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question