require函数[]中的参数和function中的对应关系,前者里面,哪些是可以在function省略?
有谁能讲下:
require函数[]中的参数和function中的对应关系,前者里面,哪些是可以在function省略?
看了有些示例:
1、require(["esri/map", "esri/layers/ArcGISTiledMapServiceLayer", "dojo/string", "dojo/domReady!"],
function (Map, ArcGISTiledMapServiceLayer, string) {...});
2、require(["dojo/parser", "esri/map", "esri/layers/ArcGISDynamicMapServiceLayer", "dojo/request/script", "dijit/registry", "dojo/json", "dijit/form/Button", "dojo/domReady!"],
function (parser, Map, ArcGISDynamicMapServiceLayer, script, registry, json) {...});
参数有的需要对应,有的不需要。
require函数[]中的参数和function中的对应关系,前者里面,哪些是可以在function省略?
看了有些示例:
1、require(["esri/map", "esri/layers/ArcGISTiledMapServiceLayer", "dojo/string", "dojo/domReady!"],
function (Map, ArcGISTiledMapServiceLayer, string) {...});
2、require(["dojo/parser", "esri/map", "esri/layers/ArcGISDynamicMapServiceLayer", "dojo/request/script", "dijit/registry", "dojo/json", "dijit/form/Button", "dojo/domReady!"],
function (parser, Map, ArcGISDynamicMapServiceLayer, script, registry, json) {...});
参数有的需要对应,有的不需要。
1 个回复
binghuan123 - 80后
赞同来自:
要回复问题请先登录或注册