ES6 Module Loader中简单导入语句和System.import之间的区别 [英] Difference between simple import statement and System.import in ES6 Module Loader
问题描述
import
和 System.import
语句之间的区别装载机(或Polyfills像System.js,Webpack等) 像
System.import( 'https://code.jquery.com/jquery.js')。然后();
似乎是可能的,以及一个简单的
import'jquery';
是 System.import
唯一的可能性在导入语句之后有回调?
您可以使用< script> ;
不支持导入的标签,也可以有条件地加载模块。
所以你可以通过API以编程方式导入模块基于ES6承诺,除了用于使用ES6导入的模块的声明性语法。
Is anybody able to explain the difference between a simple import
and a System.import
statement of the ES6 Module Loader (or Polyfills like System.js, Webpack etc.)
Something like
System.import('https://code.jquery.com/jquery.js').then();
seems to be possible, as well as a simple
import 'jquery';
Is System.import
the only possibility to have a callback after the import statement?
You can use the System.import inside <script>
tags where import aren't supported, and you can also load modules conditionally.
So you can programmatically import a module, via an API based on ES6 promises, in addition of the declarative syntax for working with modules that is the ES6 import.
这篇关于ES6 Module Loader中简单导入语句和System.import之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!