📜  js 导出为名称 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:11.653000             🧑  作者: Mango

代码示例1
//2 ways: either export with alias or import with alias  
//impor
import { grettings as welsomeMessage } from './library.js'
// Or export
let grettings = "Welcome to Noob Learner";
export { grettings as welsomeMessage };


// export feature declared earlier as default
export { myFunction as default };

// export individual features as default
export default function () { ... }
export default class { .. }

// each export overwrites the previous one