我将尝试在窗口加载时显示一个模态对话框,就像我的应用程序的许可协议。 当通过按钮单击触发时,它似乎运行良好,但是当我尝试以下操作时,它无法正常工作:
这是我VFlexBox组件数组中的内容:
这是我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事件处理程序中,它就能完美运行。