Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Cascader): tree-store children type add boolean #1615

Merged
merged 1 commit into from
Oct 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion js/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export type OptionData = {
} & PlainObject;

export type TreeOptionData<T = string | number> = {
children?: Array<TreeOptionData<T>>;
children?: Array<TreeOptionData<T>> | boolean;
/** option label content */
label?: any;
/** option search text */
Expand Down
8 changes: 4 additions & 4 deletions js/tree/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ export interface TreeNodeModel<
* 移除当前节点或当前节点的子节点,值为空则移除当前节点,值存在则移除当前节点的子节点
*/
remove: (value?: TreeNodeValue) => void;
/**
* 设置当前节点数据,数据变化可自动刷新页面,泛型 `T` 表示树节点 TS 类型
*/
/**
* 设置当前节点数据,数据变化可自动刷新页面,泛型 `T` 表示树节点 TS 类型
*/
setData: (data: T) => void;
}

Expand Down Expand Up @@ -210,7 +210,7 @@ export interface TypeTreeFilterOptions {
}

export interface TypeTreeNodeData extends TreeNodeState {
children?: TypeTreeNodeData[];
children?: TypeTreeNodeData[] | boolean;
[key: string]: any;
}

Expand Down
Loading