Skip to content

Switch

Basic usage

Disabled

Adding the disabled attribute disables Switch.

Text description

You can add checkedChildren and unCheckedChildren attribute to show texts.

Size

Loading

Setting the loading attribute to true indicates a loading state on the Switch.

Select API

Select Attributes

NameDescriptionTypeDefaultVersion
value(v-model)binding valueboolean
disableddisabledbooleanfalse
loadingloadingbooleanfalse
sizesizedefault | smalldefault
checkedChildrencontent to be shown when the state is checkedstring
unCheckedChildrencontent to be shown when the state is uncheckedstring
checkedValuevalue for checked stateboolean | string | numbertrue
unCheckedValuevalue for unchecked stateboolean | string | numberfalse

Select Events

NameDescriptionType
change仅当 modelValue 改变时(value, e) => void

Contributors

lazy

ChangeLog

4ff62 - feat: 增加选中与非选择时的值 on 12/1/2023
dc4b2 - feat: switch on 11/20/2023

Released under the MIT License.