y-taro-ui
Version:
基于taro的表单解决方案 & 基础组件
32 lines (31 loc) • 1.14 kB
TypeScript
import React from 'react';
import './index.less';
/**
* A-Z(或其它) 索引组件,数据格式固定(IndexesListProps)
* ScrollView 默认高是 100vh(因为吸顶功能,需要设置固定高),
* 如果需要自定义高度可在'scrollViewClassName'类名中设置,eg: height: calc(100vh-x);
*/
interface IndexesListItemProps {
name?: string;
}
export interface IndexesListProps<T> {
title?: string;
key?: string;
items?: T[];
}
export interface IndexesProps<T> {
list: IndexesListProps<T>[];
loading: boolean;
itemOnClick?: (item: T, parentItem: IndexesListProps<T>) => void;
itemRender?: (item: T, parentItem: IndexesListProps<T>) => React.ReactNode;
header?: () => React.ReactNode;
footer?: () => React.ReactNode;
style?: React.CSSProperties;
className?: string;
scrollViewClassName?: string;
animation?: boolean;
isVibrate?: boolean;
isShowBarTip?: boolean;
}
export declare const Indexes: <T extends IndexesListItemProps | Record<string, any> = any>(props: IndexesProps<T>) => JSX.Element;
export default Indexes;