标签
TagChip展示与容器将标签展示为可跳转的胶囊或文字:默认浅灰胶囊,solid 为陶土浅底,适配文章卡片、归档与标签列表。
属性
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
label | String | 必填 | 标签名称。 |
to | String | 必填 | 点击后的目标路径,用 Route::..to_string() 生成。 |
variant | String | outline | solid、outline 或 text。 |
count | Option<i64> | None | 可选的文章数量。 |
stop_propagation | bool | false | 阻止点击事件冒泡。 |
键盘
- Tab
- 聚焦标签
- Enter
- 打开标签页
用法
src/components/ui.rslet to = Route::TagDetail { : "\u8BBE\u8BA1".to_string() }.to_string();
view! {
<TagChip label="\u8BBE\u8BA1" to=to variant="outline" count=12/>
}