为什么通过系统导入游戏不是一种功能?
import Core from 'gameUnits/Core'
export class Game {
constructor() {核心:
export class Core {
constructor(scene) {
}
}等
在浏览器中:
<script src="bower_components/traceur/traceur.js"></script>
<script src="bower_components/es6-module-loader/dist/es6-module-loader.js"></script>
<script>
System.import('Game').then(function (Game) {
game = new Game();
});
</script>发布于 2014-12-31 10:01:39
在您的示例中,模块对象不是Game,它包含Game。尝试:
System.import('Game').then(function ({Game}) {
game = new Game();
});https://stackoverflow.com/questions/27709394
复制相似问题