mirror of
https://gitee.com/hhyykk/ipms-sjy-ui.git
synced 2025-02-01 19:24:58 +08:00
防御性编程,规避服务端children返回的不是数组时…… update src/utils/tree.ts.
Signed-off-by: 山野羡民 <liyujiang_tk@yeah.net>
This commit is contained in:
parent
e891a4bfd2
commit
b5aa9d24ac
@ -376,6 +376,9 @@ export const treeToString = (tree: any[], nodeId) => {
|
||||
let str = ''
|
||||
|
||||
function performAThoroughValidation(arr) {
|
||||
if (typeof arr === 'undefined' || !Array.isArray(arr) || arr.length === 0) {
|
||||
return false
|
||||
}
|
||||
for (const item of arr) {
|
||||
if (item.id === nodeId) {
|
||||
str += ` / ${item.name}`
|
||||
|
Loading…
Reference in New Issue
Block a user