From e3a7f7b202e791e8c71f751921eb80d4cfa2db52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=A5=E8=BE=B9=E9=A1=B5=E5=AD=97?= <1096032096@qq.com> Date: Wed, 2 Oct 2024 15:21:39 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20radio=E6=96=87=E6=A1=A3=E8=A1=A5?= =?UTF-8?q?=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/vantui/types/radio.d.ts | 50 ++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/packages/vantui/types/radio.d.ts b/packages/vantui/types/radio.d.ts index c58c2d27..f063e949 100644 --- a/packages/vantui/types/radio.d.ts +++ b/packages/vantui/types/radio.d.ts @@ -2,24 +2,74 @@ import { FunctionComponent, ReactNode } from 'react' import { ITouchEvent, ViewProps } from '@tarojs/components' export interface RadioProps extends ViewProps { + /** + * @description 标识符 + */ name?: string | number + /** + * @description + */ value?: any + /** + * @description 是否为禁用状态 + * @default false + */ disabled?: boolean + /** + * @description 选中状态颜色 + * @default #07c160 + */ checkedColor?: string + /** + * @description 文本位置,可选值为 left + * @default right + */ labelPosition?: string + /** + * @description 是否禁用文本内容点击 + * @default false + */ labelDisabled?: boolean + /** + * @description 形状,可选值为 square + * @default round + */ shape?: 'round' | 'square' + /** + * @description 图标大小,默认单位为px + * @default 20px + */ iconSize?: number | string children?: ReactNode + /** + * @description 自定义图标 + */ renderIcon?: ReactNode + /** + * @description 当绑定值变化时触发的事件 + */ onChange?: (event: ITouchEvent) => any } export interface RadioGroupProps extends ViewProps { + /** + * @description 当前选中项的标识符 + */ value?: any + /** + * @description 单选框排列方向 + * @default vertical + */ direction?: 'vertical' | 'horizontal' + /** + * @description 是否禁用所有单选框 + * @default false + */ disabled?: boolean children?: ReactNode + /** + * @description 当绑定值变化时触发的事件 + */ onChange?: (event: ITouchEvent) => any }