Skip to content

Commit 63580eb

Browse files
author
ruanyf
committed
Merge branch 'gh-pages' of github.com:ruanyf/es6tutorial into gh-pages
2 parents 3226888 + 857c4f2 commit 63580eb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/module-loader.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,10 +426,10 @@ setTimeout(_ => module.exports = null);
426426

427427
```javascript
428428
// 不正确
429-
import { readfile } from 'fs';
429+
import { readFile } from 'fs';
430430
```
431431

432-
上面的写法不正确,因为`fs`是 CommonJS 格式,只有在运行时才能确定`readfile`接口,而`import`命令要求编译时就确定这个接口。解决方法就是改为整体输入。
432+
上面的写法不正确,因为`fs`是 CommonJS 格式,只有在运行时才能确定`readFile`接口,而`import`命令要求编译时就确定这个接口。解决方法就是改为整体输入。
433433

434434
```javascript
435435
// 正确的写法一

0 commit comments

Comments
 (0)