我有以下子类,派生自 ContentPane:
define([
"dijit/layout/ContentPane",
"dojo/_base/declare"
],
function (ContentPane, declare) {
var view = declare("client.View", ContentPane, {
html: null,
constructor: function (args) {
declare.safeMixin(this, args);
if (this.html !== null) {
this.set("content", this.html);
}
}
});
return view;
}
);
现在,以下代码在 "this.set("content", this.html);" 上引发 TypeError 线:
var html = "<div>Hello</div>";
var view = View(html);
我应该如何正确设置 ContentPane 的内容?