Skip to content

Commit

Permalink
docs: translate load-on-demand
Browse files Browse the repository at this point in the history
  • Loading branch information
leftstick committed Mar 7, 2020
1 parent 4667acb commit 126fe8e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
18 changes: 7 additions & 11 deletions docs/docs/load-on-demand.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
---
translateHelp: true
---

# Load On Demand


## 启用按需加载
## How to endable

为了简化部署成本,按需加载功能默认是关闭的,你需要在使用之前先通过配置开启,
Load on demand is disabled by default in order to simplify deployment. You can enable it with below config:

```js
export default {
dynamicImport: {},
}
```

## 使用按需加载
## How to use

### 按需加载组件
### Load component on demand

通过 Umi 的 `dynamic` 接口实现,比如:
Load component via `dynamic`, for example:

```js
import { dynamic } from 'umi';
Expand All @@ -34,9 +30,9 @@ const App = dynamic({
});
```

### 按需加载非组件
### Load non-component stuff

通过 `import()` 实现,比如:
Load non-component stuff via `import()`, for example:

```js
import('g2').then(() => {
Expand Down
1 change: 1 addition & 0 deletions scripts/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const DOC_SYNC_BLACKLIST = [
'docs/getting-started.zh-CN.md',
'docs/config.zh-CN.md',
'docs/directory-structure.zh-CN.md',
'docs/load-on-demand.zh-CN.md',
];

switch (command) {
Expand Down

0 comments on commit 126fe8e

Please sign in to comment.