加减器 Stepper
数值步进器:button(−)+ 当前值 + button(+)。用于数量、倍率等离散值。
用法
#include "component/ComponentSpec.h"
using namespace dearoreui::component;
ComponentSpec stepper;
stepper.kind = ComponentKind::Stepper;
stepper.label = "数量";
stepper.value = "3";注册到页面:
oreui->registerComponent(ModId{"my-mod"}, uiManifest, stepper);属性
| 字段 | 类型 | 说明 |
|---|---|---|
kind | ComponentKind | 固定为 ComponentKind::Stepper |
label | string | 标题 |
value | string | 当前值 |
渲染结构
<div data-component="stepper">
<span>数量</span>
button(−) Text(3) button(+)
</div>[!NOTE] 增减点击交互 → C++ 分发属后续里程碑;当前
value由外部更新。