按照我的自定义小部件代码。除了事件“onShow”之外,一切正常。
有没有办法将事件“onShow”添加到自定义小部件?
谢谢!
班级:
define(["dojo/_base/declare","dijit/_WidgetBase", "dijit/_TemplatedMixin", "dijit/_WidgetsInTemplateMixin"
,"dojo/text!./templates/testWidget2.html"
],
function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin
,template
){
return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin ], {
templateString: template,
onShow: function() {
console.info("testW2 onShow")
}
});
});
模板:
<div class="${baseClass}" style="border:solid 1px green;">
<h1>W2</h1>
</div>