1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-25 11:12:21 +00:00

Merge pull request #710 from juzhiyuan/patch-1

Update module.md
This commit is contained in:
Ruan YiFeng 2018-07-04 17:07:59 +08:00 committed by GitHub
commit e11bc6133d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -453,7 +453,7 @@ export default 42;
export 42; export 42;
``` ```
上面代码中,后一句报错是因为没有指定对外的接口,而前一句指定对接口为`default` 上面代码中,后一句报错是因为没有指定对外的接口,而前一句指定对接口为`default`
有了`export default`命令,输入模块时就非常直观了,以输入 lodash 模块为例。 有了`export default`命令,输入模块时就非常直观了,以输入 lodash 模块为例。
@ -643,7 +643,7 @@ export {users} from './users';
```javascript ```javascript
// script.js // script.js
import {db, users} from './index'; import {db, users} from './constants/index';
``` ```
## import() ## import()