riku
2024-11-07 5036880fc037e5d112206b93a729f60be12bf8ab
miniprogram_npm/tdesign-miniprogram/radio/README.md
@@ -19,6 +19,12 @@
## 代码演示
<a href="https://developers.weixin.qq.com/s/GW6DrimI7hSV" 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 }}
@@ -53,14 +59,14 @@
名称 | 类型 | 默认值 | 说明 | 必传
-- | -- | -- | -- | --
placement | String | left | 复选框和内容相对位置。可选项:left/right | N
allow-uncheck | Boolean | false | 【开发中】是否允许取消选中 | N
allow-uncheck | Boolean | false | 是否允许取消选中 | N
block | Boolean | true | 是否为块级元素 | N
checked | Boolean | false | 是否选中 | N
default-checked | Boolean | undefined | 是否选中。非受控属性 | N
content | String / Slot | - | 单选内容 | N
content-disabled | Boolean | false | 是否禁用组件内容(content)触发选中 | N
readonly | Boolean | false | 只读状态 | N
disabled | Boolean | undefined | 是否为禁用态 | N
external-classes | Array | - | 组件类名,分别用于设置 组件外层、单选图标、主文案、内容 等元素类名。`['t-class', 't-class-icon', 't-class-label', 't-class-content', 't-class-border']` | N
icon | String / Array / Slot | 'circle' | 自定义选中图标和非选中图标。使用 Array 时表示:`[选中态图标,非选中态图标]`。使用 String 时,值为 circle 表示填充型图标、值为 line 表示描边型图标、值为 dot 表示圆点图标,值为 slot 时使用插槽。TS 类型:`'circle' \| 'line' \| 'dot' \| Array<string>` | N
label | String / Slot | - | 主文案 | N
max-content-row | Number | 5 | 内容最大行数限制 | N
@@ -73,6 +79,15 @@
名称 | 参数 | 描述
-- | -- | --
change | `(checked: boolean)` | 值变化时触发
### Radio 外部样式类
类名 | 说明
-- | --
t-class | 根节点样式类
t-class-label | 标签样式类
t-class-icon | 图标样式类
t-class-content | 内容样式类
t-class-border | 边框样式类
### RadioGroup Props
@@ -93,3 +108,27 @@
名称 | 参数 | 描述
-- | -- | --
change | `(value: RadioValue)` | 选中值发生变化时触发
### CSS 变量
组件提供了下列 CSS 变量,可用于自定义样式。
名称 | 默认值 | 描述
-- | -- | --
--td-radio-bg-color | @bg-color-container | -
--td-radio-border-color | @component-stroke | -
--td-radio-content-checked-color | @font-gray-2 | -
--td-radio-content-color | @font-gray-2 | -
--td-radio-content-disabled-color | @font-gray-4 | -
--td-radio-content-font-size | 28rpx | -
--td-radio-content-line-height | 44rpx | -
--td-radio-font-size | 32rpx | -
--td-radio-icon-checked-color | @brand-color | -
--td-radio-icon-color | @component-border | -
--td-radio-icon-disabled-bg-color | @bg-color-component-disabled | -
--td-radio-icon-disabled-color | @brand-color-disabled | -
--td-radio-icon-size | 48rpx | -
--td-radio-label-checked-color | @font-gray-1 | -
--td-radio-label-color | @font-gray-1 | -
--td-radio-label-disabled-color | @font-gray-4 | -
--td-radio-label-line-height | 48rpx | -
--td-radio-vertical-padding | 32rpx | -