vtils

Home > utils > TreeData > count

TreeData.count() method

计算符合条件的节点个数。不给出条件则计算所有节点的个数。

Signature:

count(predicate?: (payload: TreeDataTraverseFnPayload<TNode>) => boolean): number;

Parameters

Parameter Type Description
predicate (payload: TreeDataTraverseFnPayload<TNode>) => boolean (Optional) 条件

Returns:

number