Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: collapse文档补全 #706

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 55 additions & 1 deletion packages/vantui/types/collapse.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,62 @@ import { FunctionComponent, ReactNode } from 'react'
import { ITouchEvent, ViewProps } from '@tarojs/components'

export interface CollapseProps extends ViewProps {
/**
* @description 当前展开面板的 name
*/
value?: Array<string | number> | string
/**
* @description 是否开启手风琴模式
* @default false
*/
accordion?: boolean
/**
* @description 是否显示外边框
* @default true
*/
border?: boolean
/**
* @description
*/
children?: Array<ReactNode> | ReactNode
/**
* @description 切换面板时触发
*/
onChange?: (event: ITouchEvent) => any
/**
* @description 打开面板时触发
*/
onOpen?: (event: ITouchEvent) => any
/**
* @description 关闭面板时触发
*/
onClose?: (event: ITouchEvent) => any
}

export interface CollapseItemProps extends ViewProps {
/**
* @description 唯一标识符,默认为索引值
* @default index
*/
name?: string | number
/**
* @description 标题栏左侧内容
*/
title?: string | number
/**
* @description 标题栏右侧内容
*/
value?: string | number
/**
* @description 对应Icon的name
* @description 对应Icon的name 可选值见 Icon 组件
*/
icon?: string
/**
* @description 标题栏描述信息
*/
label?: ReactNode
/**
* @description 是否禁用面板
* @default false
*/
disabled?: boolean
Expand All @@ -29,21 +66,38 @@ export interface CollapseItemProps extends ViewProps {
*/
clickable?: boolean
/**
* @description 是否显示内边框
* @default true
*/
border?: boolean
/**
* @description 是否展示标题栏右侧箭头并开启点击反馈
* @default true
*/
isLink?: boolean
/**
* @description 面板item内容
*/
children?: ReactNode
/**
* @description 自定义标题,优先级低于title
*/
renderTitle?: ReactNode
/**
* @description 自定义icon,优先级低于icon
*/
renderIcon?: ReactNode
/**
* @description isLink 设置为 false
*/
renderRightIcon?: ReactNode
/**
* @description 自定义value,优先级低于value
*/
renderValue?: ReactNode
/**
* @description 标题栏大小,可选值为 large
*/
size?: 'large'
/**
* @description 微信端使用时, 所在元素层级太深,需要设置元素层级不是很深的父元素的className(‘.xx’)或id(#xx), 支持当前组件获取rect信息
Expand Down
Loading