diff --git a/vendor/blobt/widgets/Menu.php b/vendor/blobt/widgets/Menu.php index 6a362b4..13e2dfa 100644 --- a/vendor/blobt/widgets/Menu.php +++ b/vendor/blobt/widgets/Menu.php @@ -186,13 +186,14 @@ class Menu extends Widget { */ protected function renderItems($items) { $lines = []; + $n = count($items); foreach ($items as $i => $item) { /* 获取菜单项的自定义属性 */ $options = array_merge($this->itemOptions, ArrayHelper::getValue($item, 'options', [])); $tag = ArrayHelper::remove($options, 'tag', 'li'); $class = []; - if ($item['active']) { + if (isset($item['active'])) { $class[] = $this->activeCssClass; if (isset($item['items'])) { $class[] = $this->menuOpenClass;