我想定义自定义小部件,在里面创建一个Dijit / form / Button并添加附加点。但由于某种原因,附加点仍然是隐形的。
postCreate: function() {
require(["dijit/form/Button", "dojo/dom", "dojo/domReady!"], function(Button, dom){
// Create a button programmatically:
var myButton = new Button({
label: "Click me!",
"data-dojo-attach-point": "myButton"
}, "progButtonNode").startup();
});
console.debug(this.myButton); // returns undefined
}
答案 0 :(得分:2)