alert
Installation
import Vue from 'vue'
import { $alert } from 'veui'
Vue.use($alert)
API
After installation, this plugin provides a $alert method on all component instances, with the following signature: function(content, title, options): Promise<void>.
The method returns a Promise object that is resolved when the alert dialog is successfully closed.
| Name | Type | Description | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
content | string | The text content displayed in the alert dialog. | |||||||||||||||||||||
title | string | The title of the alert dialog. | |||||||||||||||||||||
options | Object |
|
The $alert method also provides the following shortcut methods, which set the status option to the corresponding value:
| Method | Type | Description |
|---|---|---|
success | function(content, title, options): Promise<void> | Shows an alert dialog with the "success" status. |
warn | function(content, title, options): Promise<void> | Shows an alert dialog with the "warning" status. |
info | function(content, title, options): Promise<void> | Shows an alert dialog with the "info" status. |
error | function(content, title, options): Promise<void> | Shows an alert dialog with the "error" status. |