// ----- head.js -----
export const eye = '纯洁的'
export const nose = '挺拔的'
export default {
eye,
nose
}
// ----- index.js -----
// 想实现
// import { eye, nose } from './head.js'
// export { eye, nose }
export { eye, nose } from './head.js'
// 想改名
export { eye as pureEye, nose as loftyNose } from './head.js'
// 把 head.js 所有的(default/eye/nose)导出
export * from './head.js'
export * as headObj from './head.js'
// index.html
<body>
// 静态加载,后面无法拿到js里的变量
<script type="module" src="./index.js"></script>
// 要想和数据互动
<script type="module">
import index from './index.js'
// do someting ...
</script>
</body>
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。