首页 > 代码库 > es6 export-from用法

es6 export-from用法

语法:

export * from "foo";export {foo} from "foo";export {foo, bar} from "foo";export {foo as bar} from "foo";export {foo as default} from "foo";export {foo as default, bar} from "foo";export {default} from "foo";export {default as foo} from "foo";

注意:export-from 用于聚集模块。但不能在直接使用。例如在index.js里export { a } from ‘b.js‘, a在index.js里无法使用

参考:http://blog.csdn.net/DeepLies/article/details/52916221?locationNum=13&fps=1

es6 export-from用法