From cd3b5a32e37a3226c6ef2c053e4b24ed8bde025c Mon Sep 17 00:00:00 2001 From: sunhao Date: Fri, 30 Aug 2024 09:42:05 +0800 Subject: [PATCH] * tree: fix default inner component type not work in search tree. --- lib/tree/src/components/search-tree.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/tree/src/components/search-tree.tsx b/lib/tree/src/components/search-tree.tsx index c8d254a7f2..937a0a1bf6 100644 --- a/lib/tree/src/components/search-tree.tsx +++ b/lib/tree/src/components/search-tree.tsx @@ -1,9 +1,9 @@ import {SearchMenu} from '@zui/menu/src/component'; +import {Listitem} from '@zui/list/src/component'; import {Tree} from './tree'; import type {RenderableProps} from 'preact'; import type {ClassNameLike} from '@zui/core'; -import type {Item} from '@zui/common-list'; import type {NestedItem} from '@zui/list'; import type {SearchTreeOptions} from '../types'; @@ -12,9 +12,9 @@ export class SearchTree extends static inheritNestedProps = [...SearchMenu.inheritNestedProps, 'itemActions', 'expandedIcon', 'collapsedIcon', 'normalIcon']; - static defaultItemProps: Partial = { - ...SearchMenu.defaultProps, - innerComponent: 'div', + static ItemComponents: typeof SearchMenu.ItemComponents = { + ...SearchMenu.ItemComponents, + item: [Listitem, {innerComponent: 'div'}], }; protected _getClassName(props: RenderableProps): ClassNameLike {