大飞_dafei

导航

es6 模块 export 与 import _fei

es6 模块 export 与 import

export default 命令
在一个文件或模块中,export、import 可以有多个,export default 仅有一个。
export default 中的 default 是对应的导出接口变量。
通过 export 方式导出,在导入时要加{ },export default 则不需要。
export default 向外暴露的成员,可以使用任意变量来接收

 

扩展:

es6模块 export 与 import

 

posted on 2020-05-03 06:46  大飞_dafei  阅读(85)  评论(0编辑  收藏  举报