SusTabs

标签页导航条 —— Items + 当前激活 Model。
包
SusKit · 原子(商业)
属性
| 名称 | 类型 | 默认值 | |
|---|---|---|---|
Model | Prop<string> | "" | v-model |
Color | Prop<string> | "primary" | v-model |
Align | Prop<string> | "start" | v-model |
Direction | Prop<string> | "horizontal" | v-model |
Grow | Prop<bool> | false | v-model |
SliderVisible | Prop<bool> | true | v-model |
插槽
| 名称 |
|---|
(默认) |
事件
| 名称 | 字段 | 载荷 |
|---|---|---|
TabChanged | OnTabChanged | string |
样式钩子
USS 类契约 — 无需改 C# 即可覆盖外观。状态通过这些类切换:
keyboard-focussus-tabssus-tabs__contentsus-tabs__headersus-tabs__slidersus-tabs__tabsus-tabs__tab--activesus-tabs__tab--disabledsus-tabs__tab-iconsus-tabs__tab-labelsus-tabs--align-centersus-tabs--align-endsus-tabs--align-startsus-tabs--dangersus-tabs--growsus-tabs--primarysus-tabs--secondarysus-tabs--successsus-tabs--vertical
用法
csharp
var tabs = new SusTabs();
tabs.Items.Value = new List<SusTabs.TabItem>
{
new() { Title = "Overview", Value = "overview", Icon = "house" },
new() { Title = "Loadout", Value = "loadout", Icon = "backpack" },
new() { Title = "Stats", Value = "stats", Icon = "chart-bar" },
};
tabs.Model.Value = "overview";
tabs.Color.Value = "primary";
tabs.Align.Value = "start";
tabs.SliderVisible.Value = true;
tabs.OnTabChanged += value => { /* … */ };| Prop | Role |
|---|---|
Items | List<TabItem> — Title、Value、Icon、Disabled |
Model | 当前激活的标签值 |
Align | start · center · end |
Direction | horizontal · vertical |
Grow | 拉伸标签以填满宽度 |
备注
- 默认插槽是标签面板的宿主;通过
OnTabChanged/Model切换内容。