mobile-more
Version:
基于 antd-mobile v5 扩展移动端 UI 组件
38 lines (37 loc) • 1.26 kB
TypeScript
import { CascaderProps, InputProps } from 'antd-mobile';
import * as React from 'react';
export type { CascaderProps };
type CascaderOption = CascaderProps['options'][0];
type CascaderValueExtend = Parameters<NonNullable<CascaderProps['onSelect']>>[1];
type Option = Partial<Omit<CascaderOption, 'children'>> & {
children?: Option[];
} & Record<string, any>;
export interface SuperCascaderProps extends Pick<InputProps, 'placeholder'>, Omit<CascaderProps, 'options'> {
/**
* @description 可选项。
*/
options: Option[];
/**
* @description 自定义渲染当前选中值。
* @param value 已选择项的值。
* @param items 已选择项。
* @returns
*/
renderCurrentValue?: (value: CascaderProps['value'], items: CascaderValueExtend['items']) => string | undefined;
/**
* @description 数据转换为 `label` `value` `disabled` `children` 键。
*/
mapKeys?: {
label?: string;
value?: string;
disabled?: string;
children?: string;
};
/**
* @description 默认渲染当前值的分隔符。
* @default '/'
*/
separator?: string;
}
declare const SuperCascader: React.FC<SuperCascaderProps>;
export default SuperCascader;