我正在使用 Dojo Toolkit 开发一个移动应用程序。我想制作以下小部件:
<div data-dojo-type="dojox.mobile.ListItem" data-dojoprops="moveTo:'breakdown'">
<div>Maximum: Some value</div>
</div>
我希望能够像这样使用小部件:
<div data-dojo-type="dojox.mobile.RoundRectList">
<div data-dojo-type="MyWidget" data-dojo-props="maximum:'1200'"></div>
</div>
这是我到目前为止所做的:
require(
[ "dojo/_base/declare", "dojo/parser", "dojo/ready",
"dojox/mobile/ListItem", "dijit/_WidgetBase",
"dijit/_TemplatedMixin" ],
function(declare, parser, ready, ListItem, _WidgetBase, _TemplatedMixin) {
declare("MyWidget", [ ListItem, _WidgetBase, _TemplatedMixin ], {
templateString: "<div>"
+ "<div>Maximum: <span data-dojo-attach-point='maximumNode'></span></div>"
+ "</div>",
maximum : "unknown",
_setMaximumAttr : { node : "maximumNode", type : "innerHTML" },
buildRendering : function() {
this.inherited(arguments);
}
});
ready(function() {
parser.parse();
});
});
我没有收到任何错误或类似的东西,页面没有加载。该代码有什么问题?