Import xxx from difference and import {xxx} from the

The export and import module ES

export 和 export default

Two export, let's talk about the difference between them

  1. export and export default can be used to derive constants, functions, files, modules, etc.
  2. In a file or module, export, import can have multiple, export default is only a
  3. By way of deriving export, when introduced to add {}, export default is not required
  4. export directly derived variable expression, export default not.

Reference https://www.cnblogs.com/webSong/p/8405797.html

       https://www.jianshu.com/p/50fe2d9f3c6b

Guess you like

Origin blog.csdn.net/janthinasnail/article/details/90575933