Comments (3)
// 所有包含Page的路由组件均会被预加载
boostraper.loadMatch('Page')
这个怎么实现呢?
from blog.
// router.js
const Index = () => import('../page/index')
// 预加载
router.options.routes.forEach(a => {
for (let ckey in a.components) {
if (Object.prototype.toString.call(a.components[ckey]) == "[object Function]") {
a.components[ckey].call();
}
}
})
from blog.
可以自行设计一个小型加载器。
也通过loder
方便实现,只要将资源加载交给loder
处理,就可以控制资源组件的加载时机&时序
http://ldocs.scoii.com/docs/LazyLoading.html
from blog.
Related Issues (17)
- Gulp使用入门
- 技能树升级——Chrome Headless模式 HOT 6
- 极致Web性能 —— 图说舌尖上的脚本
- 极致PCWeb性能 —— 同步加载vs异步加载
- 极致PCWeb性能 —— 静态化&工程化JSONP HOT 4
- 没有了CommonsChunkPlugin,咱拿什么来分包(译) HOT 5
- Hyperapp源码分析 HOT 2
- 跪求黑苹果EFI HOT 1
- 前端webpack workflow(一)——Webpack入门
- 前端webpack workflow(二)——Webpack基本使用 HOT 20
- 告别React Constant HOT 2
- React组件/元素与实例分析 HOT 2
- redux入门指南(一) HOT 1
- redux入门指南(二)
- 前端与算法 HOT 2
- 组件设计模式
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blog.