|
|
@@ -27,7 +27,8 @@ const LeftTab = React.createClass({
|
|
|
let cur, sub, sut;
|
|
|
if (rid.length > 1) {
|
|
|
for (var h = 0; h < menu.length; h++) {
|
|
|
- if (menu[h].subMenus.length) {
|
|
|
+ console.log(menu[h].subMenus)
|
|
|
+ if (menu[h].subMenus && menu[h].subMenus.length) {
|
|
|
menu[h].subMenus.map(function (atem) {
|
|
|
let urls = atem.url.split('#')
|
|
|
if (rid[1] == urls[1]) {
|
|
|
@@ -51,7 +52,7 @@ const LeftTab = React.createClass({
|
|
|
});
|
|
|
var htmlMenu = [];
|
|
|
for (var j = 0; j < menu.length; j++) {
|
|
|
- if (menu[j].subMenus.length) {
|
|
|
+ if (menu[j].subMenus && menu[j].subMenus.length) {
|
|
|
htmlMenu.push(
|
|
|
<SubMenu key={menu[j].url} title={<span>{menu[j].name}</span>}>
|
|
|
{
|
|
|
@@ -76,7 +77,7 @@ const LeftTab = React.createClass({
|
|
|
if (window.location.hash && menu[0].subMenus.length) {
|
|
|
let theKey = window.location.hash.substr(1);
|
|
|
menu.map(function (item1) {
|
|
|
- item1.subMenus.map(function (item2) {
|
|
|
+ item1.subMenus && item1.subMenus.map(function (item2) {
|
|
|
let urls = item2.url.split('#')
|
|
|
if (theKey == urls[1]) {
|
|
|
_me.state.subKey = item1.url
|