// declar
const a = 1
const b = 2
export { a, b } //注意这里仅仅是一个**固定语法**,而不是说导出了一个对象

//use
import {a,b} from '...js' //同时这里也是**固定语法**,不是解构
// declar
const a = 1
const b = 2
export defalut { a, b } 

//use
import x from '...js‘ //这里x拿到的是对象的引用

import {a,b} from '...js' //这样就会报错  因为不是解构
Last modification:April 23rd, 2021 at 12:58 am
If you think my article is useful to you, please feel free to appreciate