Components
Alert
Displays a short, prominent message. Can be dismissed by the user or close itself after a duration.
import { AlertComponent } from '@/MigsLab/shared'
Types
Info: a new version is available.
Success: your changes were saved.
Warning: your session expires in 5 minutes.
Danger: the record could not be deleted.
<AlertComponent type="info">Info: a new version is available.</AlertComponent>
<AlertComponent type="success">Success: your changes were saved.</AlertComponent>
<AlertComponent type="warning" :dismissible="false">Warning...</AlertComponent>
<AlertComponent type="danger">Danger...</AlertComponent>Auto close
Set duration in milliseconds. The closed event fires on manual or automatic close.
This alert closes itself after 3 seconds.
<AlertComponent type="success" :duration="3000" @closed="Alert_Closed">
This alert closes itself after 3 seconds.
</AlertComponent>API
Props
| Name | Type | Default | Description |
|---|---|---|---|
type | 'info' | 'success' | 'warning' | 'danger' | 'info' | Color scheme of the alert. |
dismissible | boolean | true | Show a close button. |
duration | number | 0 | Milliseconds before the alert closes itself. 0 keeps it open. |
Events
| Event | Payload | Description |
|---|---|---|
closed | — | Emitted once when the alert closes, manually or automatically. |
Slots
| Name | Description |
|---|---|
default | Alert message. |