跳到主要内容

eo-checkbox

<eo-checkbox>
Alias: <form.general-checkbox>

表单复选框构件。

Playground

Examples​

Label​

Playground

Value​

Playground

Options​

Playground

Disabled​

Playground

Type​

Playground

checkboxColor​

Playground

optionGroups​

Playground

Event​

Playground

With Form​

Playground

Properties​

NameDescriptionTypeDefaultRequired
name

字段名称

string
label

字段说明

string
value

值

CheckboxValueType[]
options

多选框选项表

CheckboxOptionType[] []✅
type

类型

CheckboxType "default"
disabled

是否禁用

boolean
isCustom

是否为自定义

boolean false
required

是否必填

boolean
message

校验文本

Record<string, string>
isGroup

是否为复选框,为true时,则可设置分组数据 optionGroups

boolean
optionGroups

多选框选项分组数据,需要设置 isGroup 为 true 才生效

OptionGroup[]
themeVariant

主题变体

"default" | "elevo"

Events​

NameDescriptionEvent Detail
change

复选框变化事件

CheckboxOptionType[]
options.change

复选框变化事件

OptionsChangeEventDetail

Type references​

CheckboxOptionType​

NameDescriptionTypeDefaultRequired
labelReact.ReactNode✅
valueany✅
styleReact.CSSProperties
disabledboolean
checkboxColorstring
[propName: string]any

OptionGroup​

NameDescriptionTypeDefaultRequired
namestring✅
keystring✅
optionsCheckboxOptionType[]✅

OptionsChangeEventDetail​

NameDescriptionTypeDefaultRequired
optionsCheckboxOptionType[]✅
namestring✅

CheckboxValueType​

string | number | boolean

CheckboxType​

"default" | "icon"