Dojo说" dojo AMD格式,使代码更容易编写和调试" (https://dojotoolkit.org/documentation/tutorials/1.10/modules_advanced/)
有没有人可以向我们展示一个示例代码来证明这个陈述? 坦克:)
答案 0 :(得分:1)
有关basic privacy policy template here的更多信息。
导航栏的简单模块示例:
// in "my/widget/NavBar.js"
define([
"dojo/_base/declare",
"dijit/_WidgetBase",
"dijit/_TemplatedMixin",
"dojo/text!./templates/NavBar.html"
], function(declare, _WidgetBase, _TemplatedMixin, template){
return declare([_WidgetBase, _TemplatedMixin], {
// template contains the content of the file "my/widget/templates/NavBar.html"
templateString: template
});
});