diff --git a/js/common.ts b/js/common.ts index 55ddd0fde4..28bed13f35 100644 --- a/js/common.ts +++ b/js/common.ts @@ -6,7 +6,7 @@ export type OptionData = { } & PlainObject; export type TreeOptionData = { - children?: Array>; + children?: Array> | boolean; /** option label content */ label?: any; /** option search text */ diff --git a/js/tree/types.ts b/js/tree/types.ts index fa843a0713..7bf71f5a46 100644 --- a/js/tree/types.ts +++ b/js/tree/types.ts @@ -177,9 +177,9 @@ export interface TreeNodeModel< * 移除当前节点或当前节点的子节点,值为空则移除当前节点,值存在则移除当前节点的子节点 */ remove: (value?: TreeNodeValue) => void; - /** - * 设置当前节点数据,数据变化可自动刷新页面,泛型 `T` 表示树节点 TS 类型 - */ + /** + * 设置当前节点数据,数据变化可自动刷新页面,泛型 `T` 表示树节点 TS 类型 + */ setData: (data: T) => void; } @@ -210,7 +210,7 @@ export interface TypeTreeFilterOptions { } export interface TypeTreeNodeData extends TreeNodeState { - children?: TypeTreeNodeData[]; + children?: TypeTreeNodeData[] | boolean; [key: string]: any; }