//先定义后导出var name ='zjl'var age =18functiontest1(){...}functiontest2(){....}functiontest3(){...}classclass1{.....}//as:为更名 export{name,age}export{ test1 as fun1,test2 as fun2,test3 as fun3}export{class1}//---------------------------------------------------------------//甚至可以这样直接导出exportfunctionsum(x,y){return x+y;}exportvar x =10
ES6的导入和导出模块1.导出模块1.1普通的export导出方式//先定义后导出var name = 'zjl'var age = 18function test1(){...}function test2(){....}function test3(){...}class class1{.....}//as:为更名 export {name,age}export { test1 as fun1,test2 as fun2,test3 as fun3}export {class