a.jslet test = function() { }export default { test}b.jsimport { test } from 'a.js'console.log(test) // undefinedimport all from 'a.js'console.log(all) // {test: f}
1 回答
慕村225694
TA贡献1880条经验 获得超4个赞
export default test 就可以了
a.js
let test = function() {
}
export default test
b.js
import test from 'a.js'
console.log(test) // undefined
或者
export const test = function () {}
import {test} from 'a.js'
添加回答
举报
0/150
提交
取消
