javascript export and export default
1. export
//a.js
export const name = "eddy";
export function hello(name) {
console.log("hello", name);
}
//b.js
import { name, hello} from "./a.js";
hello(name);//hello eddy
2. export default
//a-default.js
const name = "eddy default";
function h
原创
2020-06-03 16:53:58 ·
149 阅读 ·
0 评论