es6模块
es6 Module
export
export 输出方式一:
1 | export var firstName = "Galen"; |
export 输出方式二:
1 | var firstName = "Galen"; |
输出重命名
1 | export { |
import
输入命令
1 | import { firstName, lastName, year } from './app' |
输入重命名
1 | import { firstName as fN } from './app' |
整体输入
1 | import * as person from './app'; |
export default默认输出输入
1 | export default function(){ |