我试图在加载窗口后立即显示 ModalDialog,类似于我的应用程序的许可协议。当点击按钮触发时它似乎工作正常,但当我尝试这个时不起作用:
这是在我的 VFlexBox 类型的组件数组中:
{ name: "theDialog", kind: "ModalDialog", components: [
{ content: "This is a Dialog Box" },
{ layoutKind: "HFlexLayout", pack: "center", components: [
{ name: "okayButton", kind: "Button", caption: "Okay" },
{ name: "closeButton", kind: "Button", caption: "Close" }
]}
]}
这就是我试图显示对话框的地方。
create: function() {
this.inherited(arguments);
this.$.theDialog.openAtCenter();
}
如果我放置了 this.$.theDialog.openAtCenter(); 在按钮的 onclick 事件的处理程序中,它工作得非常好。