SusIconRail
![]()
垂直或水平排列的圆形类别 / 配装条目条带。
包
SusKit · 原子(商业)
属性
| 名称 | 类型 | 默认值 | |
|---|---|---|---|
Model | Prop<string> | "" | v-model |
Direction | Prop<string> | "vertical" | v-model |
插槽
没有插槽。
事件
| 名称 | 字段 | 载荷 |
|---|---|---|
Changed | OnChanged | string |
样式钩子
USS 类契约 — 无需改 C# 即可覆盖外观。状态通过这些类切换:
sus-icon-rail__iconsus-icon-rail__itemsus-icon-rail__item--activesus-icon-rail__item--disabledsus-icon-rail__item--hsus-icon-rail__labelsus-icon-rail--horizontalsus-icon-rail--vertical
用法
csharp
var rail = new SusIconRail();
rail.SetLabels("W", "A", "Q", "M");
rail.Model.Value = "0";
rail.Direction.Value = "vertical";
rail.OnChanged += value => { /* … */ };或显式构建 Items:
csharp
rail.Items.Value = new List<SusIconRail.RailItem>
{
new() { Label = "W", Value = "weapons", Icon = "sword" },
new() { Label = "A", Value = "armor", Icon = "shield" },
};
rail.Model.Value = "weapons";| 属性 | 作用 |
|---|---|
Items | List<RailItem> — Label、Value、Icon、Disabled |
Model | 选中值 |
Direction | vertical | horizontal |
OnChanged | Action<string> |
备注
SetLabels(...)是一个快捷方法,用字母标签和索引值填充Items。- 根布局通常需要消费方 USS:Sharq 作用域可能会破坏
.sus-icon-rail上的 self-target。
另请参阅 布局技巧。