For vue2 projects, use @94ai/common-ui
LLMs.md

Alert ​

Display success, warning, information and error alerts with the original appearance, HTML title/description and three slots. Supports Chalk/OEM component themes.

Themes / icons / closing / centering ​

Loading example…
Themes / icons / closing / centering

Supporting descriptions ​

Loading example…
Supporting descriptions

Custom slots ​

Loading example…
Custom slots

Interactive example ​

close: 0; submit: 0

On-demand import ​

ts
import NfAlert from '@94ai-plus/nf-alert'
import '@94ai-plus/nf-theme-chalk/nf-alert.css'

app.use(NfAlert)

Types ​

ts
import type { AlertProps, AlertType, AlertEffect, AlertInstance } from '@94ai-plus/nf-alert'
// AlertType: 'success' | 'warning' | 'info' | 'error'
// AlertEffect: 'light' | 'dark'
// AlertInstance: { close(): void }

Attribute ​

parametersDescriptionTypeOptional valueDefault value
titleTitle, supports trusted HTML; can also be passed in via the title slot.string—''
descriptionSupporting text. It can also be passed in through the default slot, and the default slot takes priority.string—''
typeAlert typestringsuccess/warning/info/error'info'
closableCan it be closedboolean—true
close-textClose button custom textstring—''
showIconWhether to display the iconboolean—true
centerIs the text centered?boolean—false
effectVisual themestringlight/dark'light'

Event ​

event nameDescriptioncallback parameters
closeEvent triggered when alert is turned off—

Slot ​

NameDescriptionSlot parameters
defaultDescription—
titleTitle content—
closeCustom close control{ close: () => void }

Migration instructions ​

Reserves 8 properties, no-argument close event, and three slots. Fixed the problem of the description disappearing when the default slot and description are passed in at the same time, and changed it to slot priority; fixed the problem of repeatedly closing the trigger event after being hidden. After closing, updating properties will not automatically reopen. Please remount via key.

The close button is changed to a native button, which supports keyboard operations, accessibility labels in eight languages, and does not submit the form. The icons are changed to built-in SVG and do not rely on Element UI fonts. The close slot has a new close callback, and the instance has a new close() method. The effect controls the appearance of the prompt box and is independent of the white and black theme of the document/drill field.