外观
InputGroup 组合输入框
将文本框与前缀、后缀或清除按钮组合到同一输入边框中。
import { SInputGroup } from '@icecreamqaq/shadcn/input-group'使用示例
常用 API
| 成员 | 类型 | 用法 |
|---|---|---|
SInputGroupInput / SInputGroupTextarea | 组件 | 分别渲染单行和多行控件,可在具体控件上使用 v-model。 |
SInputGroupAddon.align | "inline-start" | "inline-end" | "block-start" | "block-end" | 默认 inline-start。使用 block-start 或 block-end 可把附件置于控件上方或下方。 |
SInputGroupButton.size | "xs" | "sm" | "icon-xs" | "icon-sm" | 按钮默认大小为 xs,默认外观为 ghost。 |
SInputGroupText | 组件 | 用于协议、单位等随输入框显示的文字。点击附件的非按钮区域会聚焦输入控件。 |
完整 API
InputGroup2 个成员
属性
| 名称 | 类型 |
|---|---|
class | ClassValue |
插槽
| 名称 | 类型 |
|---|---|
default | ((props: {}) => any) |
InputGroupAddon3 个成员
属性
| 名称 | 类型 |
|---|---|
align | "inline-start" | "inline-end" | "block-start" | "block-end" | null |
class | ClassValue |
插槽
| 名称 | 类型 |
|---|---|
default | ((props: {}) => any) |
InputGroupButton4 个成员
属性
| 名称 | 类型 |
|---|---|
variant | "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | null |
size | "xs" | "sm" | "icon-xs" | "icon-sm" | null |
class | ClassValue |
插槽
| 名称 | 类型 |
|---|---|
default | ((props: {}) => any) |
InputGroupInput1 个成员
属性
| 名称 | 类型 |
|---|---|
class | ClassValue |
InputGroupText2 个成员
属性
| 名称 | 类型 |
|---|---|
class | ClassValue |
插槽
| 名称 | 类型 |
|---|---|
default | ((props: {}) => any) |
InputGroupTextarea1 个成员
属性
| 名称 | 类型 |
|---|---|
class | ClassValue |
分组导出
模板标签为 <s-input-group>。
组件 SInputGroup、SInputGroupAddon、SInputGroupButton、SInputGroupInput、SInputGroupText、SInputGroupTextarea
函数与常量 inputGroupAddonVariants、inputGroupButtonVariants
类型 InputGroupButtonVariants、InputGroupVariants