首页 > 其他 > 详细

ES2015 import & export

时间:2017-04-29 13:37:35      阅读:441      评论:0      收藏:0      [点我收藏+]

ES2015 import

  The import statement is used to import functions, objects or primitives that have been exported from an external module, another script, etc.

  用于导出已经声明为export的function、object。

  注意不存在import * from ‘module-name‘的用法,只能是import * as name from ‘module-name‘。

  注意导入export default,应当使用 import name from ‘module-name‘

  注意导入export,应该加上{},如import {name} from ‘module-name‘

ES2015 export

  The export statement is used to export functions, objects or primitives from a given file (or module).

参考:

1、https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import

2、https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export

ES2015 import & export

原文:http://www.cnblogs.com/tekkaman/p/6784997.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!