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

文档修复-tabbar-修改的的types文件非README.md #678

Merged
merged 5 commits into from
Aug 28, 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
54 changes: 54 additions & 0 deletions packages/vantui/types/tabbar.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,45 @@ import { FunctionComponent, ReactNode } from 'react'
import { ViewProps } from '@tarojs/components'

export interface TabbarProps extends ViewProps {
/**
* @description 绑定当前选中标签的标识符
*/
active?: string | number
/**
* @description 激活状态的颜色
*/
activeColor?: string
/**
* @description 默认状态的颜色
*/
inactiveColor?: string
/**
* @description 是否固定在底部
* @default true
*/
fixed?: boolean
/**
* @description 固定在底部时,是否在标签位置生成一个等高的占位元素
* @default false
*/
placeholder?: boolean
/**
* @description 是否显示外边框
* @default true
*/
border?: boolean
/**
* @description 元素 z-index
*/
zIndex?: number
/**
* @description 是否开启底部安全区适配
*/
safeAreaInsetBottom?: boolean
children?: ReactNode
/**
* @description 切换标签时触发
*/
onChange?: (event: { detail: string | number }) => void
/**
* @description 微信端使用时, 所在元素层级太深,需要设置元素层级不是很深的父元素的className(‘.xx’)或id(#xx), 支持当前组件获取rect信息
Expand All @@ -20,13 +50,37 @@ export interface TabbarProps extends ViewProps {

export interface TabbarItemProps extends Omit<ViewProps, 'onClick'> {
info?: ReactNode
/**
* @description 标签名称,作为匹配的标识符
* @default 当前标签的索引值
*/
name?: string | number
/**
* @description 图标名称或图片链接,等同于 Icon 组件的 name 属性
*/
icon?: string
/**
* @description 是否显示图标右上角小红点
* @default false
*/
dot?: boolean
/**
* @description 图标类名前缀
* @default van-icon
*/
iconPrefix?: string
/**
* @description 自定义选中的图标
*/
renderIconActive?: ReactNode
/**
* @description 自定义默认的图标
*/
renderIcon?: ReactNode
children?: ReactNode
/**
* @description 切换标签时触发
*/
onClick?: (name: string | number) => void
}

Expand Down
Loading