From d7b89f4664417c9a764342b6bebe1702a3f7921c 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: Tue, 6 Aug 2024 15:58:10 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=AE=98?= =?UTF-8?q?=E6=96=B9=E6=96=87=E6=A1=A3=E7=82=B9=E5=87=BB=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E5=A4=8D=E5=88=B6icon=E5=8A=9F=E8=83=BD=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/vantui/src/icon/demo/demo2.tsx | 2 ++ packages/vantui/src/icon/demo/demo3.tsx | 2 ++ packages/vantui/src/icon/demo/demo4.tsx | 2 ++ packages/vantui/src/icon/wxs.ts | 16 +++++++++++++++- 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/packages/vantui/src/icon/demo/demo2.tsx b/packages/vantui/src/icon/demo/demo2.tsx index e78932f0a..2fc9d461a 100644 --- a/packages/vantui/src/icon/demo/demo2.tsx +++ b/packages/vantui/src/icon/demo/demo2.tsx @@ -1,6 +1,7 @@ import { Text } from '@tarojs/components' import icons from '@vant/icons' import { Col, Icon } from '@antmjs/vantui' +import * as computed from '../wxs' export default function Demo() { return ( @@ -10,6 +11,7 @@ export default function Demo() { key={i} span="6" style={{ paddingTop: '20px', paddingBottom: '20px' }} + onClick={() => computed.copyIcon(name)} > {name} diff --git a/packages/vantui/src/icon/demo/demo3.tsx b/packages/vantui/src/icon/demo/demo3.tsx index 893371b60..90cebdc6e 100644 --- a/packages/vantui/src/icon/demo/demo3.tsx +++ b/packages/vantui/src/icon/demo/demo3.tsx @@ -1,6 +1,7 @@ import { Text } from '@tarojs/components' import icons from '@vant/icons' import { Col, Icon } from '@antmjs/vantui' +import * as computed from '../wxs' export default function Demo() { return ( @@ -10,6 +11,7 @@ export default function Demo() { key={i} span="6" style={{ paddingTop: '20px', paddingBottom: '20px', height: '100px' }} + onClick={() => computed.copyIcon(name)} > {name} diff --git a/packages/vantui/src/icon/demo/demo4.tsx b/packages/vantui/src/icon/demo/demo4.tsx index 7b8d7ae76..d6ad4cd8d 100644 --- a/packages/vantui/src/icon/demo/demo4.tsx +++ b/packages/vantui/src/icon/demo/demo4.tsx @@ -1,6 +1,7 @@ import { Text } from '@tarojs/components' import icons from '@vant/icons' import { Col, Icon } from '@antmjs/vantui' +import * as computed from '../wxs' export default function Demo() { return ( @@ -10,6 +11,7 @@ export default function Demo() { key={i} span="6" style={{ paddingTop: '20px', paddingBottom: '20px', height: '100px' }} + onClick={() => computed.copyIcon(name)} > {name} diff --git a/packages/vantui/src/icon/wxs.ts b/packages/vantui/src/icon/wxs.ts index b723c1e8b..b2b967c84 100644 --- a/packages/vantui/src/icon/wxs.ts +++ b/packages/vantui/src/icon/wxs.ts @@ -1,3 +1,4 @@ +import Taro from '@tarojs/taro' import { style } from '../wxs/style' import { addUnit } from '../wxs/add-unit' @@ -33,4 +34,17 @@ function rootStyle(data: any) { ]) } -export { isImage, rootClass, rootStyle } +//复制icon +function copyIcon(name: string) { + Taro.setClipboardData({ + data: ``, + success: () => { + Taro.showToast({ + title: '复制成功', + icon: 'none', + }) + }, + }) +} + +export { isImage, rootClass, rootStyle, copyIcon } From 3f29659e2161788dfad2393bc3929b603e197e39 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: Thu, 8 Aug 2024 15:18:58 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20=E6=81=A2=E5=A4=8Dmain=E5=88=86?= =?UTF-8?q?=E6=94=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/vantui/src/icon/demo/demo2.tsx | 2 -- packages/vantui/src/icon/demo/demo3.tsx | 2 -- packages/vantui/src/icon/demo/demo4.tsx | 2 -- packages/vantui/src/icon/wxs.ts | 16 +--------------- 4 files changed, 1 insertion(+), 21 deletions(-) diff --git a/packages/vantui/src/icon/demo/demo2.tsx b/packages/vantui/src/icon/demo/demo2.tsx index 2fc9d461a..e78932f0a 100644 --- a/packages/vantui/src/icon/demo/demo2.tsx +++ b/packages/vantui/src/icon/demo/demo2.tsx @@ -1,7 +1,6 @@ import { Text } from '@tarojs/components' import icons from '@vant/icons' import { Col, Icon } from '@antmjs/vantui' -import * as computed from '../wxs' export default function Demo() { return ( @@ -11,7 +10,6 @@ export default function Demo() { key={i} span="6" style={{ paddingTop: '20px', paddingBottom: '20px' }} - onClick={() => computed.copyIcon(name)} > {name} diff --git a/packages/vantui/src/icon/demo/demo3.tsx b/packages/vantui/src/icon/demo/demo3.tsx index 90cebdc6e..893371b60 100644 --- a/packages/vantui/src/icon/demo/demo3.tsx +++ b/packages/vantui/src/icon/demo/demo3.tsx @@ -1,7 +1,6 @@ import { Text } from '@tarojs/components' import icons from '@vant/icons' import { Col, Icon } from '@antmjs/vantui' -import * as computed from '../wxs' export default function Demo() { return ( @@ -11,7 +10,6 @@ export default function Demo() { key={i} span="6" style={{ paddingTop: '20px', paddingBottom: '20px', height: '100px' }} - onClick={() => computed.copyIcon(name)} > {name} diff --git a/packages/vantui/src/icon/demo/demo4.tsx b/packages/vantui/src/icon/demo/demo4.tsx index d6ad4cd8d..7b8d7ae76 100644 --- a/packages/vantui/src/icon/demo/demo4.tsx +++ b/packages/vantui/src/icon/demo/demo4.tsx @@ -1,7 +1,6 @@ import { Text } from '@tarojs/components' import icons from '@vant/icons' import { Col, Icon } from '@antmjs/vantui' -import * as computed from '../wxs' export default function Demo() { return ( @@ -11,7 +10,6 @@ export default function Demo() { key={i} span="6" style={{ paddingTop: '20px', paddingBottom: '20px', height: '100px' }} - onClick={() => computed.copyIcon(name)} > {name} diff --git a/packages/vantui/src/icon/wxs.ts b/packages/vantui/src/icon/wxs.ts index b2b967c84..b723c1e8b 100644 --- a/packages/vantui/src/icon/wxs.ts +++ b/packages/vantui/src/icon/wxs.ts @@ -1,4 +1,3 @@ -import Taro from '@tarojs/taro' import { style } from '../wxs/style' import { addUnit } from '../wxs/add-unit' @@ -34,17 +33,4 @@ function rootStyle(data: any) { ]) } -//复制icon -function copyIcon(name: string) { - Taro.setClipboardData({ - data: ``, - success: () => { - Taro.showToast({ - title: '复制成功', - icon: 'none', - }) - }, - }) -} - -export { isImage, rootClass, rootStyle, copyIcon } +export { isImage, rootClass, rootStyle } From 678c503b2780a554c7ae01ad584b7e3fc233a3c6 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, 14 Aug 2024 13:34:00 +0800 Subject: [PATCH 3/3] =?UTF-8?q?docs:=20treeSelect=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/vantui/types/tree-select.d.ts | 34 +++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/packages/vantui/types/tree-select.d.ts b/packages/vantui/types/tree-select.d.ts index d798a0e0d..1f8611e81 100644 --- a/packages/vantui/types/tree-select.d.ts +++ b/packages/vantui/types/tree-select.d.ts @@ -1,6 +1,10 @@ import { FunctionComponent, TouchEvent, ReactNode } from 'react' import { ViewProps } from '@tarojs/components' export interface TreeSelectProps extends ViewProps { + /** + * @description 分类显示所需的数据 + * @default [] + */ items?: { text: number | string badge?: number | string @@ -12,12 +16,34 @@ export interface TreeSelectProps extends ViewProps { disabled?: boolean }[] }[] + /** + * @description 右侧选中项的 id,支持传入数组 + * @default - + */ activeId?: string | number | number[] | string[] + /** + * @description 左侧选中项的索引 + * @default 0 + */ mainActiveIndex?: number - value?: number + /** + * @description 高度,默认单位为px + * @default 300 + */ height?: number | string + /** + * @description 右侧项最大选中个数 + * @default Infinity + */ max?: number + /** + * @description 自定义右侧栏选中状态的图标 + * @default success + */ selectedIcon?: string + /** + * @description 点击右侧选择项时触发 + */ onClickItem?: ( event: TouchEvent & { detail: { @@ -27,7 +53,13 @@ export interface TreeSelectProps extends ViewProps { } }, ) => void + /** + * @description 点击左侧导航时触发 + */ onClickNav?: (event: { detail: { index: number } }) => void + /** + * @description 自定义右侧的显示内容 + */ renderContent?: ReactNode } declare const TreeSelect: FunctionComponent