GenericModalContent

通用 OK/Cancel 对话框主体 — 标题横幅、info 正文、带标签的主按钮。
包
SusGame · 屏幕(商业)
SusGame · Screens
属性
| 名称 | 类型 | 默认值 | |
|---|---|---|---|
TitleText | Prop<string> | "" | |
BodyText | Prop<string> | "" | |
OkLabel | Prop<string> | "OK" |
插槽
没有插槽。
事件
没有公开事件。
样式钩子
USS 类契约 — 无需改 C# 即可覆盖外观。状态通过这些类切换:
generic-modal-contentsus-flow-actions-rowsus-flow-btn--mr12
用法
xml
<template>
<sus:GenericModalContent
:TitleText="Title.Value"
:BodyText="Body.Value"
:OkLabel="Ok.Value"
/>
</template>
<script>
public Prop<string> Title = new("Confirm");
public Prop<string> Body = new("Proceed?");
public Prop<string> Ok = new("OK");
</script>csharp
var dlg = new GenericModalContent();
dlg.TitleText.Value = "Delete item?";
dlg.BodyText.Value = "This cannot be undone.";
dlg.OkLabel.Value = "Delete";
dlg.OkBtn.OnClick += () => { /* confirm */ };
dlg.CancelBtn.OnClick += () => { /* dismiss */ };| Prop / API | Role |
|---|---|
TitleText | 标题横幅 |
BodyText | 正文 SusAlert(info) |
OkLabel | 主按钮文本 |
OkBtn / CancelBtn | 宿主动作接线 |
备注
- 仅是内容;modal chrome / 关闭由宿主提供。
- Cancel 文本固定(「Cancel」)— 只有 OK 由 prop 驱动。