MigsLab UIVue 3 component workshop

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

<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.

<AlertComponent type="success" :duration="3000" @closed="Alert_Closed">
  This alert closes itself after 3 seconds.
</AlertComponent>

API

Props

NameType Default Description
type'info' | 'success' | 'warning' | 'danger''info'Color scheme of the alert.
dismissiblebooleantrueShow a close button.
durationnumber0Milliseconds before the alert closes itself. 0 keeps it open.

Events

EventPayloadDescription
closed—Emitted once when the alert closes, manually or automatically.

Slots

NameDescription
defaultAlert message.