html5 - If the vue SPA project has too many components, wouldn't the packaged files be too large?
伊谢尔伦
伊谢尔伦 2017-05-16 13:42:05
0
4
409

Isn’t it very slow when loading for the first time? Is my question reasonable? How to deal with it?

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(4)
Peter_Zhu

There are too many components, so routing is usually added, right? Then just use lazy loading in vue-router...
https://router.vuejs.org/zh-c...

伊谢尔伦

Can be loaded asynchronously. For example, if I have 10 pages, the total package size may be 10M, which is definitely too large. Then I can package the home page and load the others asynchronously, loading which one is accessed. This will make it faster to open for the first time.

You can see vue-router documentation for lazy loading https://router.vuejs.org/zh-c...

小葫芦

Added that vue2 also has a server-side rendering solution that can solve performance problems

伊谢尔伦

Lazy loading can be achieved through vue-router and webpack

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!