1
我是新來的Dojo和想不通爲什麼會這樣在Dojo中加載模塊變量?
在dojo.html:
在a.jsdefine([], function() {
var a = {
"sheep": "blah",
}
return a;
});
要求和加載模塊
require(["dojo/query", "dojo/NodeList-dom", "dojo/domReady!", "a" ], function(query, a) {
query("#greeting").style("color", "red");
alert(a.sheep);
});
很好,但是當我嘗試提醒a.sheep時,我得到了不確定。 注意:我也嘗試過申報羊:「blah」,並嘗試將羊改爲alert函數並運行a.sheep;哪些工作。