<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
</body>
<script type="module">
import * as m1 from './js/modejs.js'
console.log(m1)
</script>
</html>
//js文件
//暴露数据方式一
export let name = '张三'
export function getname(){
console.log('张三')
}
******************************
//暴露数据方式二
let name = '张三'
function getname(){
console.log('张三')
}
export {name,getname} // 暴露数据
***********************************
//暴露数据方式三(默认暴露方式)
export default{
name :'张三'
getname:function (){
console.log('张三')
}
}