|
@@ -7,7 +7,7 @@
|
|
(!onlyOneChild.children ||
|
|
(!onlyOneChild.children ||
|
|
onlyOneChild.noShowingChildren ||
|
|
onlyOneChild.noShowingChildren ||
|
|
(onlyOneChild.children &&
|
|
(onlyOneChild.children &&
|
|
- onlyOneChild.children.length < 1 &&
|
|
|
|
|
|
+ onlyOneChild.children&& onlyOneChild.children.length < 1 &&
|
|
(onlyOneChild.name == 'issue_index' ||
|
|
(onlyOneChild.name == 'issue_index' ||
|
|
onlyOneChild.name == 'notice_index' ||
|
|
onlyOneChild.name == 'notice_index' ||
|
|
onlyOneChild.name == 'dashboard'))) &&
|
|
onlyOneChild.name == 'dashboard'))) &&
|
|
@@ -78,7 +78,7 @@ export default {
|
|
// Temp set(will be used if only has one showing child)
|
|
// Temp set(will be used if only has one showing child)
|
|
|
|
|
|
// 删除空的children
|
|
// 删除空的children
|
|
- if (item.children.length < 1) {
|
|
|
|
|
|
+ if (item.children&&item.children.length < 1) {
|
|
// delete item['children']
|
|
// delete item['children']
|
|
}
|
|
}
|
|
|
|
|
|
@@ -90,12 +90,12 @@ export default {
|
|
})
|
|
})
|
|
|
|
|
|
// When there is only one child router, the child router is displayed by default
|
|
// When there is only one child router, the child router is displayed by default
|
|
- if (showingChildren.length === 1) {
|
|
|
|
|
|
+ if (showingChildren&&showingChildren.length === 1) {
|
|
return true
|
|
return true
|
|
}
|
|
}
|
|
|
|
|
|
// Show parent if there are no child router to display
|
|
// Show parent if there are no child router to display
|
|
- if (showingChildren.length === 0) {
|
|
|
|
|
|
+ if (showingChildren&&showingChildren.length === 0) {
|
|
this.onlyOneChild = { ...parent, path: '', noShowingChildren: true }
|
|
this.onlyOneChild = { ...parent, path: '', noShowingChildren: true }
|
|
return true
|
|
return true
|
|
}
|
|
}
|