<分区>
为什么下面这个例子没有输出“hello world”?相反,我得到:
TypeError: _base2.default.test is not a function
(正在用 Babel 转译)
file1.js
import Example from './file2';
console.log(Example.test());
file2.js
export default class Example {
test() {
console.log('hello world');
}
}