摘要: exports和module.exports的作用都是将文件模板的方法和属性暴露给require返回的对象进行调用。但是两者有本质的区别,exports的属性和方法都可以被module.exports替代。 如下代码是一样的: 但是exports不能替代module.exports的方法,所有的ex 阅读全文
posted @ 2017-02-19 12:48 iwang5566 阅读(171) 评论(0) 推荐(0) 编辑