module.exports 与 export区别

1.module.exports = * && exports.** = *   ==> commenjs   

用法  

module.exports = whiteBoards

var whiteBoards || (aaa) = require("whiteBoards");

whiteBoards();

 

exports.whiteBoards = whiteBoards

var name = require("whiteBoards");

name. whiteBoards();


2.export default  && default   ==>es6

用法

export default whiteBoards

import whiteBoards from ""

export whiteBoards

import { whiteBoards } from ""

 

 

 

posted @ 2020-07-06 11:29  Lucky_web_刘  阅读(172)  评论(0编辑  收藏  举报