ES6 how to export all item from one file

前端 未结 2 380
醉酒成梦
醉酒成梦 2021-01-22 01:15

I want to export all methods of a file from another file.

currently I am doing this, and it works. How can I merge below two into 1 export expression

imp         


        
2条回答
  •  温柔的废话
    2021-01-22 01:41

    You cannot in ES2016. To create a module namespace object, you need to give it an identifier (like db) in your current module scope, and then re-export that. There's no way around it.

    There is however a stage 1 proposal to add the export * as default from … syntax you were trying.

提交回复
热议问题