组件
ShadcnInputGroup
组合输入:前缀/后缀(图标或文本),padding 自动让位。

带前缀/后缀的组合输入框(shadcn InputGroup)。基于 ShadcnInput 扩展,addon 内嵌在输入框内,聚焦时整框一起 ring。
用法
// 前缀图标(如搜索)
ShadcnInputGroup {
width: 260
prefixIcon: "search"
placeholderText: qsTr("搜索...")
}
// 前缀文本(如货币符号)
ShadcnInputGroup {
width: 260
prefixText: "¥"
placeholderText: qsTr("金额")
}
// 后缀图标
ShadcnInputGroup {
width: 260
suffixIcon: "chevron-down"
placeholderText: qsTr("下拉")
}
属性
| 属性 | 类型 | 说明 |
|---|---|---|
prefixIcon / suffixIcon | string | 前后缀图标(lucide 名,16px mutedForeground) |
prefixText / suffixText | string | 前后缀文本(如 $ / ¥) |
| 其余 | — | 同 ShadcnInput(placeholderText / text / enabled 等) |
说明
- 有 addon 时输入框 padding 自动让位(36px),addon 与文字不重叠
- 聚焦时整框(含 addon)一起显示 ring
