//A.js
module.exports = {
a:aa,
b:bb
}
//B.js 引入,以下方式都对
import A from './A'
import myA from './A'
//以下方式都错
import {A} from './A'
import {myA} from './A'
//A.js
export const a_config = {
a:aa,
b:bb
}
export const other_config = {
c:cc,
d:dd
}
module.exports = {
abc:a_config,
other_config:other_config
}
//B.js 引入,以下方式都对
import {abc} from './A'
import {other_config} from './A'
import config from './A' //默认第一个
(a,b)=>{
let c = 'hello'
return c + a + b
}