我想以以下方式导出一些模块,但总是失败。。
foo.js
我不知道为什么我不能使用第一种方法从
foo.js
const foo = {
a: 'b'
};
export default foo;
index.js
export foo from './foo'; // encounter error here
export * from './foo'; // it works..
我不知道为什么我不能使用第一种方法从
foo.js
导出模块,在我看来,我可以导出任何东西,比如函数、类、变量等。