| | |
| | | |
| | | ## 代码演示 |
| | | |
| | | <a href="https://developers.weixin.qq.com/s/ea6Lpim37ISs" title="在开发者工具中预览效果" target="_blank" rel="noopener noreferrer"> 在开发者工具中预览效果 </a> |
| | | |
| | | <blockquote style="background-color: #d9e1ff; font-size: 15px; line-height: 26px;margin: 16px 0 0;padding: 16px; border-radius: 6px; color: #0052d9" > |
| | | <p>Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"</p> |
| | | </blockquote> |
| | | |
| | | ### 基础开关 |
| | | |
| | | {{ base }} |
| | |
| | | 名称 | 参数 | 描述 |
| | | -- | -- | -- |
| | | change | `(value: SwitchValue)` | 数据发生变化时触发 |
| | | |
| | | |
| | | ### CSS 变量 |
| | | 组件提供了下列 CSS 变量,可用于自定义样式。 |
| | | 名称 | 默认值 | 描述 |
| | | -- | -- | -- |
| | | --td-switch-checked-color | @brand-color | - |
| | | --td-switch-checked-disabled-color | @brand-color-disabled | - |
| | | --td-switch-dot-border-color | @bg-color-secondarycontainer | - |
| | | --td-switch-dot-horizontal-margin | 6rpx | - |
| | | --td-switch-dot-large-size | 52rpx | - |
| | | --td-switch-dot-plain-horizontal-margin | 10rpx | - |
| | | --td-switch-dot-plain-large-size | 44rpx | - |
| | | --td-switch-dot-plain-size | 36rpx | - |
| | | --td-switch-dot-plain-small-size | 28rpx | - |
| | | --td-switch-dot-shadow | @shadow-1 | - |
| | | --td-switch-dot-size | 44rpx | - |
| | | --td-switch-dot-small-size | 36rpx | - |
| | | --td-switch-height | 56rpx | - |
| | | --td-switch-icon-large-size | 48rpx | - |
| | | --td-switch-icon-size | 40rpx | - |
| | | --td-switch-icon-small-size | 32rpx | - |
| | | --td-switch-label-checked-color | @switch-checked-color | - |
| | | --td-switch-label-color | @font-gray-4 | - |
| | | --td-switch-label-font-size | 28rpx | - |
| | | --td-switch-label-large-font-size | 32rpx | - |
| | | --td-switch-label-small-font-size | 24rpx | - |
| | | --td-switch-large-height | 64rpx | - |
| | | --td-switch-large-radius | calc(@switch-large-height / 2) | - |
| | | --td-switch-large-width | 104rpx | - |
| | | --td-switch-radius | calc(@switch-height / 2) | - |
| | | --td-switch-small-height | 48rpx | - |
| | | --td-switch-small-radius | calc(@switch-small-height / 2) | - |
| | | --td-switch-small-width | 78rpx | - |
| | | --td-switch-unchecked-color | @font-gray-4 | - |
| | | --td-switch-unchecked-disabled-color | @bg-color-component-disabled | - |
| | | --td-switch-width | 90rpx | - |