@tarojsx/ui
Version:
We reinvents the UI for Taro3+
43 lines (42 loc) • 1.67 kB
TypeScript
import React from 'react';
import { CommonEventFunction } from '@tarojs/components';
import '../style/TabBar.scss';
export declare type TabBarListItem = {
/** key */
key?: string;
/** 标题 */
title: string;
/** icon className 前缀,用于第三方字体图标库,比如想使用'fa fa-clock' 的图标,则 传入`iconPrefixClass='fa' iconType='clock'`,[拓展图标库详细](https://taro-ui.jd.com/#/docs/icon) */
iconPrefixClass?: string;
/** 未选中时展示的 icon 类型,可扩展第三方字体图标库,[拓展图标库详细](https://taro-ui.jd.com/#/docs/icon) */
iconType?: string;
/** 选中时展示的 icon 类型,可扩展第三方字体图标库,[拓展图标库详细](https://taro-ui.jd.com/#/docs/icon) */
selectedIconType?: string;
/** 未选中时图片icon的链接 */
image?: string;
/** 选中时图片icon的链接 */
selectedImage?: string;
/** 右上角显示到文本,可以为数字或文字,如果有 dot,优先显示 dot */
text?: string;
/** text 可显示的最大数字,超过则显示最大数字加'+',如'99+' */
max?: number;
/** 是否显示红点,优先级比 text 高 */
dot?: boolean;
};
export interface TabBarProps {
className?: string;
style?: React.CSSProperties;
backgroundColor?: string;
color?: string;
selectedColor?: string;
iconSize?: number;
fontSize?: number;
current?: number;
fixed?: boolean;
scroll?: boolean;
tabList: TabBarListItem[];
onClick?: CommonEventFunction<{
value: number;
}>;
}
export declare const TabBar: React.FC<TabBarProps>;