文件的导入 与 导出

1. 导出 :  export defalut  函数名                     导入:   import  '函数名'  form   './文件名'
2.  导出:  module.exports =  函数名               导入: const    a    =  require('./ 文件名')

3.导出: export defalut  函数名             等价于   module.exports = { ' defalut ' : "函数名"}   
  导入: const {'defalut' :  函数名} = require("./文件名")    等价于   import  '函数名'  from   './文件名'

posted @ 2016-08-17 18:41  蝴蝶女郎  阅读(113)  评论(0)    收藏  举报