小程序开放平台
文档中心
小程序
控制台
登录
指南
框架
组件
JS API
服务端 API
开发工具
常见问题
表单组件
button
checkbox
checkbox-group
editor
form
input
label
picker
picker-view
picker-view-column
radio
radio-group
slider
switch
textarea
基础内容
icon
progress
rich-text
text
媒体组件
image
video
video-player
地图
map
视图容器
movable-area
movable-view
scroll-view
swiper
swiper-item
view
导航组件
navigator
开放能力
web-view
post-note-button
group-chat-card
video-player
画布
canvas
switch
开发
>
组件
>
表单组件
>
switch
>
更新时间:2025-12-09 15:37:02
switch
开关选择器
属性
类型
默认值
必填
说明
checked
boolean
false
是否选中
disabled
boolean
false
是否禁用
type
string
switch
样式,有效值:switch, checkbox
color
string
#04BE02
switch 的颜色,同 css 的 color
bindchange
eventhandle
checked 改变时触发 change 事件,event.detail={ value}
扫码预览
组件示例
复制代码
该文档是否对您有帮助?
switch
扫码预览
组件示例