Skip to content

Commit

Permalink
refactor(TreeSelect): ts & docs & test tools
Browse files Browse the repository at this point in the history
  • Loading branch information
zizairufengLT committed May 8, 2024
1 parent d58c35d commit 356661a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/tree-select/tree-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ class TreeSelect extends Component<TreeSelectProps, TreeSelectState> {
const retainedNodes: NodeElement[] = [];

data!.forEach((item, index) => {
const { children, value, ...others } = item as ObjectItem;
const { children, ...others } = item as ObjectItem;
const pos = `${prefix}-${index}`;
const key = this.state._p2n[pos].key as string;
const addNode = (isParentMatched?: boolean, hide?: boolean) => {
Expand Down
4 changes: 2 additions & 2 deletions components/tree/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { CommonProps } from '../util';
import type { VirtualListProps } from '../virtual-list';
import type { Tree } from './view/tree';
import type { TreeNode } from './view/tree-node';
import type { ObjectItem } from '../select';
import type { DataSourceItem } from '../select';

export type Key = string;
export type KeyEntities = Record<Key, DataNode>;
Expand Down Expand Up @@ -259,7 +259,7 @@ export interface NodeProps extends CommonProps {
* @en value
* @skip
*/
value?: ObjectItem['value'];
value?: DataSourceItem;
}

export type NodeElement = React.ReactElement<NodeProps>;
Expand Down

0 comments on commit 356661a

Please sign in to comment.