N
N
Nikita Egorov2018-06-09 22:42:23
Web development
Nikita Egorov, 2018-06-09 22:42:23

How to load vue components dynamically for vue-router?

Hello.
As soon as I started learning vue, I immediately asked myself the following question:
Let's say we have three pages - home, auth, guide. Each page has logic (js), styles and markup. All this is bundled into one file and it turns out to be quite large. If, for example, the user only came to see the guide, then he would have to load the styles, logic, and markup of other pages as well. This is not good. How can you dynamically load vue components using vue-router?
While google found exactly the problem that I described, but did not understand the solution at all ... Although I use webpack (also new to it).
Vuejs.org
and
developers.google
Can someone explain, well, or throw links where it is chewed ... Thanks

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Stolyarov, 2018-06-09
@svupol

https://medium.com/js-dojo/build-a-lazy-load-route...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question