Commit b4662e18 authored by leon's avatar leon

fix: judge array can not find element

parent 9bdbb125
...@@ -277,13 +277,17 @@ ...@@ -277,13 +277,17 @@
if (item.child.index.length) { if (item.child.index.length) {
item.child.index.forEach(child => { item.child.index.forEach(child => {
const index = data.list.findIndex(i => i.id === child ) const index = data.list.findIndex(i => i.id === child )
data.list[index].linkTabsId = item.id if(index != -1) {
data.list[index].linkTabsId = item.id
}
}) })
} }
if (item.child.data.length) { if (item.child.data.length) {
item.child.data.forEach(child => { item.child.data.forEach(child => {
const index = data.list.findIndex(i => i.id === child.comp ) const index = data.list.findIndex(i => i.id === child.comp )
data.list[index].linkTabsId = item.id if(index != -1) {
data.list[index].linkTabsId = item.id
}
}) })
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment