We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
export命令由于是es6语法,所以在node环境中需要用babel进行转码
// profile.js // 必须放在全局作用域,不然报错 var name = "Bob"; var age = 23; export {name, age};
import命令由于是es6语法,所以在node环境中需要用babel进行转码
// main.js import {name, age} from"./profile"; // import “./profile” 转码之后即为 require("./profile");
// main.js module circle from "./circle";
// exports只是module.exports的一个辅助方法 // 推荐方式 exports.add = add; // module.exports是真是存在的东西 // 不推荐 module.exports = add;
The text was updated successfully, but these errors were encountered:
No branches or pull requests
export命令(用于导出)
import命令(用于接收)
Module
module.extprts与exports.的区别
The text was updated successfully, but these errors were encountered: