function say(){ console.log("say hello11") } function hi(){ console.log("say hi11") } //commonjs-----exports----- //module.exports.say=say //const sayhi=require('./crc32.js') sayhi.say() //module.exports.say=say //const sayhi=require('./crc32.js') sayhi() //const sayhi=require('./crc32.js') sayhi() sayhi.say() sayhi.hi() // exports.say=say // exports.hi=hi //------export------- //const num=20; //export default num; //import num from './crc32' export const say1=function(){ console.log("say1 hello") } function hi1(){ console.log("say111hi11") } export {hi1} //import { say1, hi1 } from './crc32'
//https://blog.csdn.net/qq_31967569/article/details/82461499