1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-24 10:22:23 +00:00

Update module.md

This commit is contained in:
Jacty 2017-07-13 13:26:35 +08:00 committed by GitHub
parent f301b5d989
commit 2dbd318fce

View File

@ -205,7 +205,7 @@ function setName(element) {
import { lastName as surname } from './profile';
```
`import`后面的`from`指定模块文件的位置,可以是相对路径,也可以是绝对路径,`.js`路径可以省略。如果只是模块名,不带有路径,那么必须有配置文件,告诉 JavaScript 引擎该模块的位置。
`import`后面的`from`指定模块文件的位置,可以是相对路径,也可以是绝对路径,`.js`后缀可以省略。如果只是模块名,不带有路径,那么必须有配置文件,告诉 JavaScript 引擎该模块的位置。
```javascript
import {myMethod} from 'util';