关于 export default 和 export

 1 // 第一组
 2 export default function crc32() { // 输出
 3   // ...
 4 }
 5 
 6 import crc32 from 'crc32'; // 输入
 7 
 8 // 第二组
 9 export function crc32() { // 输出
10   // ...
11 };
12 
13 import {crc32} from 'crc32'; // 输入

第一组是使用export default时,对应的import语句不需要使用大括号;第二组是不使用export default时,对应的import语句需要使用大括号。

原文地址:https://www.cnblogs.com/happiness86/p/10615228.html