小编Bha*_*all的帖子

在Enyo窗口加载时显示ModalDialog

我试图在窗口加载后立即显示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" }
    ]}
]}
Run Code Online (Sandbox Code Playgroud)

这就是我试图展示对话框的地方.

create: function() {
   this.inherited(arguments);
   this.$.theDialog.openAtCenter();
}
Run Code Online (Sandbox Code Playgroud)

如果我放置了这个.$.theDialog.openAtCenter(); 在Button的onclick事件的处理程序内,它工作得非常好.

modal-dialog webos enyo

3
推荐指数
1
解决办法
541
查看次数

标签 统计

enyo ×1

modal-dialog ×1

webos ×1