props.d.ts 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import { IBaseProps } from '../_util/base';
  2. import { IBadgeProps } from '../Badge/props';
  3. export interface ITabItem {
  4. /**
  5. * @description 底部图标,支持 Icon 或图片
  6. * @default ''
  7. */
  8. icon?: string;
  9. /**
  10. * @description 高亮状态的底部图标,支持 Icon 或图片
  11. * @default ''
  12. */
  13. activeIcon?: string;
  14. /**
  15. * @description 底部的文本信息
  16. * @default ''
  17. */
  18. text: string;
  19. /**
  20. * @description 徽标,参见 <Badge/> 组件
  21. * @default undefined
  22. */
  23. badge?: IBadgeProps;
  24. }
  25. /**
  26. * @description 标签栏,内部配合 TabItem 使用。
  27. */
  28. export interface ITabBarProps extends IBaseProps {
  29. /**
  30. * @description tabbar 配置,为一个数组
  31. * @default []
  32. */
  33. items: ITabItem[];
  34. /**
  35. * @description 选中
  36. */
  37. current: number;
  38. /**
  39. * @description 初始值
  40. */
  41. defaultCurrent: number;
  42. /**
  43. * @description 高亮状态图标和文本的颜色
  44. */
  45. activeColor: string;
  46. /**
  47. * @description tabbar 切换时的回调
  48. */
  49. onChange: (index: number, e: Record<string, any>) => void;
  50. }
  51. export declare const TabBarDefaultProps: Partial<ITabBarProps>;