关于export defalut 适合单个模块的抛出,在引用 的时候自定义方法名
export default function () {
let name
="我是来自export default 模块的变量";
console
.log(name
)
}
引用
import name
from './js/es6default'
name()
export 可以抛出做个模块,根据自己的需求引入不同模块
export function show(){
console
.log("模块化执行show的方法")
}
export let show1=()=>{
console
.log("模块化执行show1的方法")
}
export const P="我是常量";
let method=function(){
}
let method2=function(){
}
export {method
,method2
}
按需调用
import {show
,show1
,P} from './js/es6'、
show()
show1()
alert(P)
转载请注明原文地址:https://ipadbbs.8miu.com/read-23593.html