继承
none
属性
名称 | 类型 | 描述 | 默认 |
---|---|---|---|
ok | string | 确定按钮文本。 | Ok |
cancel | string | 取消按钮文本。 | Cancel |
title | string | 消息标题。 | |
msg | string | 要在对话框中显示的消息。 | |
icon | string | 要在对话框上显示的图标类。 |
方法
名称 | 参数 | 返回值 | 描述 |
---|---|---|---|
alert | options | void |
显示警告消息对话框。
代码实例: this.$messager.alert({ title: "Info", icon: "info", msg: "Here is a info message!" }); |
confirm | options | void |
显示确认消息对话框。
代码实例: this.$messager.confirm({ title: "Confirm", msg: "Are you confirm this?", result: r => { if (r) { alert("confirmed: " + r); } } }); |
prompt | options | void |
显示提示消息对话框。
代码实例: this.$messager.prompt({ title: "Prompt", msg: "Please type something", result: r => { if (r) { alert("you type: " + r); } } }); |