Fixed sidebar repeat

Fixed sidebar repeat if a top state name contains another sidebar state name
pull/325/head
Brooks Liu 2017-08-03 12:10:10 +08:00 committed by GitHub
parent 1f81f3b1c1
commit e8aa95c8d6
1 changed files with 1 additions and 1 deletions

View File

@ -27,7 +27,7 @@
menuItems.forEach(function(item) {
var children = states.filter(function(child) {
return child.level == 1 && child.name.indexOf(item.name) === 0;
return child.level == 1 && child.name.split('.')[0] === item.name;
});
item.subMenu = children.length ? children : null;
});