exports和module.exports的区别

module.exports返回的是一个{}

expoerts是对module.exports的一个引用;

即:

module.exports = {

  abc: ‘abc’

};

exports.hehe = ‘hehe’;

等价于:

module.exports = {

  abc: ‘abc’,

  hehe: ‘hehe’

}

posted @ 2018-03-22 16:50  hello八戒  阅读(211)  评论(0编辑  收藏  举报