mirror of
https://github.com/certd/certd.git
synced 2026-05-15 20:47:31 +08:00
perf: 易支付支持固定支付方式,适合没有收银台版本使用
This commit is contained in:
@@ -7,6 +7,17 @@ export function eachTree(tree: any[], callback: (item: any) => void) {
|
||||
});
|
||||
}
|
||||
|
||||
export function treeMap(tree: any[], mapFunc: (item: any) => {}) {
|
||||
return tree.map((item: any) => {
|
||||
const newItem: any = mapFunc(item);
|
||||
if (item.children) {
|
||||
newItem.children = treeMap(item.children, mapFunc);
|
||||
}
|
||||
return newItem;
|
||||
});
|
||||
}
|
||||
|
||||
export const treeUtils = {
|
||||
eachTree
|
||||
eachTree,
|
||||
treeMap
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user