From 42f61c68c72a21e626d520bc944fe067c6a44127 Mon Sep 17 00:00:00 2001 From: Heising Date: Sun, 8 Oct 2023 09:37:47 +0800 Subject: [PATCH] fix(Cascader): tree-store children type add boolean --- js/common.ts | 2 +- js/tree/types.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/js/common.ts b/js/common.ts index c5f6eda552..789ca462d4 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; }