SusChip

紧凑标签 / 筛选器 — 文本、图标,可关闭和选中状态。
包
SusKit · 原子(商业)
属性
| 名称 | 类型 | 默认值 | |
|---|---|---|---|
Label | Prop<string> | "" | v-model |
PrependIcon | Prop<string> | "" | v-model |
AppendIcon | Prop<string> | "" | v-model |
Closable | Prop<bool> | false | v-model |
Disabled | Prop<bool> | false | v-model |
Variant | Prop<string> | "tonal" | v-model |
Color | Prop<string> | "primary" | v-model |
Size | Prop<string> | "default" | v-model |
Selected | Prop<bool> | false | v-model |
插槽
| 名称 |
|---|
(默认) |
事件
| 名称 | 字段 | 载荷 |
|---|---|---|
Close | OnClose | — |
样式钩子
USS 类契约 — 无需改 C# 即可覆盖外观。状态通过这些类切换:
keyboard-focussus-chipsus-chip__append-iconsus-chip__closesus-chip__prepend-iconsus-chip__textsus-chip--closablesus-chip--dangersus-chip--disabledsus-chip--elevatedsus-chip--filledsus-chip--flatsus-chip--infosus-chip--outlinedsus-chip--primarysus-chip--secondarysus-chip--selectedsus-chip--size-largesus-chip--size-smallsus-chip--size-x-smallsus-chip--successsus-chip--textsus-chip--tonalsus-chip--warningsus-slotunity-labelunity-text-element
用法
xml
<template>
<sus:SusChip Label="Legendary"
Variant="tonal"
Color="warning"
PrependIcon="star"
Closable="true"
@close="OnRemove" />
</template>
<script>
void OnRemove() { /* … */ }
</script>csharp
var chip = new SusChip();
chip.Label.Value = "Filter";
chip.Variant.Value = "tonal";
chip.Color.Value = "primary";
chip.Selected.Value = true;
chip.OnClose += () => { /* … */ };变体
filled · elevated · tonal · outlined · flat · text