Skip to content

Commit 022cc75

Browse files
authored
fix(nav-menu): [nav-menu] fix the e2e error in the nav-menu component (#2883)
1 parent c6c00fc commit 022cc75

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/utils/src/array/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ export const transformPidToChildren = (data, pidName = 'pId', childrenName = 'ch
200200

201201
Array.isArray(data) &&
202202
data.forEach((item) => {
203-
if (item[pidName] === '0') {
203+
if (!item[pidName] || item[pidName] === '0') {
204204
result.push(item)
205205
} else {
206206
const parent = find(data, (i) => i[idName] === item[pidName])

0 commit comments

Comments
 (0)