diff --git a/src/views/trainingPlatform/demonList.vue b/src/views/trainingPlatform/demonList.vue index 989c293f5..6a32f2603 100644 --- a/src/views/trainingPlatform/demonList.vue +++ b/src/views/trainingPlatform/demonList.vue @@ -178,18 +178,20 @@ export default { this.treeList = []; res.data.forEach(item => { const childList = []; - item && item.children && item.children.length > 3 && item.children.forEach(elem => { - if (elem.id === 'Lesson') { - childList[0] = elem; - } else if (elem.id === 'Exam') { - childList[3] = elem; - } else if (elem.id === 'Simulation') { - childList[1] = elem; - } else { - childList[2] = elem; - } - }); - item.children = childList; + if (item && item.children && item.children.length > 3) { + item.children.forEach(elem => { + if (elem.id === 'Lesson') { + childList[0] = elem; + } else if (elem.id === 'Exam') { + childList[3] = elem; + } else if (elem.id === 'Simulation') { + childList[1] = elem; + } else { + childList[2] = elem; + } + }); + item.children = childList; + } }); } this.treeList = res.data;