interface AdcTabBar { /** * 文本名称. */ text: string; /** * 页面路径. */ pagePath: string; /** * 默认Icon链接. */ iconPath: string; /** * 选中时Icon链接. */ selectedIconPath: string; /** * 跳转方式, 若为switchTab跳转需要在app.json里的tabBar中声明, 默认`switchTab`. */ navigateType?: string; /** * 是否显示凸出的图标, 默认`false`. */ showBig?: boolean; /** * Icon的style样式. */ iconStyle?: string; /** * 图标右上角徽标的内容. */ num?: string; /** * 是否显示图标右上角小红点, 默认`false`. */ dot?: boolean; } /** * 能力中心小程序标签栏组件,支持2种标签栏格式,可自定义style,支持点击标签跳转拦截事件。 * 使用时也需要在`app.json`中设置`tabBar:{}`。 * * @see https://mas.alipay.com/material/component?id=75000009 */ interface AdcTabBarProps { /** * 自定义样式. */ className?: string; /** * 未选中字体颜色, 默认`#888888`. */ color?: string; /** * 选中字体颜色, 默认`#fe8b1e`. */ selectedColor?: string; /** * 字体大小, 默认`24rpx`. */ fontSize?: string; /** * 背景颜色, 默认`#ffffff`. */ bgColor?: string; /** * 自定义TabBar `border-top`样式. */ topLineStyle?: string; /** * 标签列表, 默认`[]`. */ tabBarList: AdcTabBar[]; /** * 标签跳转拦截事件,需返回 true / false, 返回false阻止tabbar跳转事件继续往下执行. * onChangeTabBar标签跳转拦截事件,支持2种模式调用,同步任务和异步任务。 */ onChangeTabBar?: (tab: { index: number; }) => boolean | Promise; } export default AdcTabBar; export type { AdcTabBar, AdcTabBarProps };