ES6模块化引入
//a.js 导出的关键字 export export let str = "laowang"; export function add(a,b){ return a + b ; } // b.js 导入的关键字 import
// (内容)被导入的属性或者方法
import{str,add} from "./a.js"; console.log(str); console.log(add); //b.html <script src = "b.js" type = module> </script>

浙公网安备 33010602011771号