SusAlert

行内反馈块 — 标题 + 正文,类型化严重级别,可选关闭。
包
SusKit · 原子(商业)
属性
| 名称 | 类型 | 默认值 | |
|---|---|---|---|
Type | Prop<string> | "info" | v-model |
Text | Prop<string> | "" | v-model |
Title | Prop<string> | "" | v-model |
Icon | Prop<string> | "" | v-model |
Closable | Prop<bool> | false | v-model |
Prominent | Prop<bool> | false | v-model |
Border | Prop<string> | "left" | v-model |
Density | Prop<string> | "default" | v-model |
Variant | Prop<string> | "tonal" | v-model |
插槽
| 名称 |
|---|
(默认) |
事件
| 名称 | 字段 | 载荷 |
|---|---|---|
Close | OnClose | — |
样式钩子
USS 类契约 — 无需改 C# 即可覆盖外观。状态通过这些类切换:
sus-alertsus-alert__bodysus-alert__closesus-alert__iconsus-alert__textsus-alert__titlesus-alert--border-bottomsus-alert--border-leftsus-alert--border-rightsus-alert--border-topsus-alert--closablesus-alert--density-comfortablesus-alert--density-compactsus-alert--errorsus-alert--flatsus-alert--infosus-alert--outlinedsus-alert--prominentsus-alert--successsus-alert--textsus-alert--tonalsus-alert--warningunity-labelunity-text-element
用法
xml
<template>
<sus:SusAlert Type="warning"
Title="Unsaved changes"
Text="Leave this screen and you will lose edits."
Variant="tonal"
Closable="true"
@close="OnDismiss" />
</template>
<script>
void OnDismiss() { /* hide or clear */ }
</script>csharp
var alert = new SusAlert();
alert.Type.Value = "info";
alert.Title.Value = "Sync complete";
alert.Text.Value = "Your loadout is up to date.";
alert.Variant.Value = "tonal";
alert.OnClose += () => { /* … */ };类型
info · success · warning · error
变体
tonal · outlined · text · flat