Browse Source

feat: add type

pull/25067/head
zoomdong 5 years ago
parent
commit
d4384c4fdc
  1. 4
      components/tree/Tree.tsx
  2. 2
      components/tree/utils/iconUtil.tsx

4
components/tree/Tree.tsx

@ -91,8 +91,8 @@ export interface AntTreeNodeDropEvent {
// [Legacy] Compatible for v3
export type TreeNodeNormal = DataNode;
export interface TreeProps extends Omit<RcTreeProps, 'prefixCls'> {
showLine?: boolean;
export interface TreeProps extends Omit<RcTreeProps, 'prefixCls' | 'showLine'> {
showLine?: boolean | { hideLeafIcon: boolean };
className?: string;
/** 是否支持多选 */
multiple?: boolean;

2
components/tree/utils/iconUtil.tsx

@ -11,7 +11,7 @@ import { isValidElement, cloneElement } from '../../_util/reactNode';
export default function renderSwitcherIcon(
prefixCls: string,
switcherIcon: React.ReactNode | null | undefined,
showLine: boolean | undefined,
showLine: boolean | { hideLeafIcon: boolean } | undefined,
{ isLeaf, expanded, loading }: AntTreeNodeProps,
) {
if (loading) {

Loading…
Cancel
Save