Alert
Introduction
The alert widget is a basic component that displays important information or warnings in the user interface.
Configuration items
Category |
Configuration |
Example |
Description |
Content |
Type |
The widget has four types: default, success, warning, and error. |
|
Content |
The title of the alert. |
||
Description |
The text description of the alert. |
||
Show icon |
Shows or hides the icon on the widget frontend. |
||
Icon |
The icon displayed in the alert. |
||
Interaction |
Hidden |
Hides the widget. For more information, see Common properties. |
|
Closable |
Makes the alert closable. |
||
Style |
Margin |
The outer margin. For more information, see Common properties. |
|
Content font size |
The font size of the alert title. |
||
Description font size |
Warning box Description font size |
Properties and methods
Name |
Type |
Example |
Description |
type |
string |
|
The alert type. The value can be `info`, `success`, `warning`, or `error`. |
message |
string |
|
The content of the alert. |
description |
string |
|
The description of the alert. |
closable |
boolean |
|
Specifies whether the alert widget can be closed. |
hidden |
boolean |
|
Specifies whether the widget is hidden. |
clearClosable |
func |
|
Clears the `closable` value of the widget. |
clearDescription |
func |
|
Clears the `description` value of the widget. |
clearHidden |
func |
|
Clears the `hidden` value of the widget. |
clearMessage |
func |
|
Clears the `message` value of the widget. |
clearType |
func |
|
Clears the `type` value of the widget. |
setClosable |
func |
|
Sets whether the alert widget can be closed. |
setHidden |
func |
|
Sets whether the alert widget is hidden. |
setDescription |
func |
|
Sets the description of the alert widget. |
setMessage |
func |
|
Sets the content of the alert widget. |
setType |
func |
|
Sets the `type` value of the widget. The value can be `info`, `success`, `warning`, or `error`. |
Event callbacks
Configuration |
Description |
The callback that is triggered when the alert is closed. |