Skip to Content
Components徽标 Badge

徽标 Badge

角标/徽章:bubble + 文本。用于数量提示、状态标记。

用法

#include "component/ComponentSpec.h" using namespace dearoreui::component; ComponentSpec badge; badge.kind = ComponentKind::Badge; badge.label = "3"; // 徽标内容 badge.variant = "base"; // base / action

注册到页面:

oreui->registerComponent(ModId{"my-mod"}, uiManifest, badge);

属性

字段类型说明
kindComponentKind固定为 ComponentKind::Badge
labelstring徽标文本(数量/状态)
variantstringbase / action(气泡变体)
statestring状态切换(default 等)

拼装结构

bubble └─ Text(徽标内容,小字号居中)

相关