我需要做类似的事情:
if (condition) {
import something from 'something';
}
// ...
if (something) {
something.doStuff();
}
上面的代码无法编译;它抛出SyntaxError: ... 'import' and 'export' may only appear at the top level。
我尝试使用此处System.import所示的方法,但是我不知道从哪里来。是ES6提案最终没有被接受吗?该文章中指向“编程API”的链接将我转至不推荐使用的docs页面。System
DIEA
富国沪深
烙印99
相关分类