@meleon/uni-ui
Version:
A uniapp components library written in vue3 and typescript
40 lines (39 loc) • 1.2 kB
TypeScript
import type { Key2TreeNode, TreeNodeEntity } from '../index.interface';
/**
* @description 更新父级节点的选中情况
* @param options
*/
export declare function updateParentCheckedKeys(options: {
node: TreeNodeEntity;
checkedKeySet: Set<string>;
indeterminateKeySet: Set<string>;
}): void;
/**
* @description 获取当前节点所有可选中的子节点
* @param node
* @returns
*/
export declare function getChildrenKeys(node: TreeNodeEntity): string[];
interface GetCheckStateInput {
node: TreeNodeEntity;
checked: boolean;
checkedKeys: string[];
indeterminateKeys: string[];
}
/**
* @description 更新当前节点的父子节点的选中情况
* @param options
* @returns
*/
export declare function getCheckState(options: GetCheckStateInput): string[][];
interface GetCheckStateWithIntialKeysInput {
initialCheckedKeys: string[];
key2TreeNode: Key2TreeNode;
}
/**
* @description 根据默认选中的节点 keys 列表,计算出半选节点
* @param options
* @returns
*/
export declare function getCheckStateWithIntialKeys(options: GetCheckStateWithIntialKeysInput): string[][];
export {};