浏览器中使用 ES6 import

html 中的 head 标签引入:html <script src="test.js" type="module"></script> test.js :node import { a } from "./test2.js"; console.log(a);//0 test2.js:浏览器 'use strict' let a = 0; export { a }; node 版本:8.9,从官网
相关文章
相关标签/搜索