* zin: add tree and preserve props to moduleMenu.

This commit is contained in:
sunhao
2024-04-01 13:56:42 +08:00
parent 6b7322922c
commit e230d09830
+10 -6
View File
@@ -21,6 +21,8 @@ class moduleMenu extends wg
'titleShow?: bool=true',
'app?: string=""',
'checkbox?: bool',
'preserve?: string|bool',
'tree?: array',
'checkOnClick?: bool|string',
'onCheck?: function'
);
@@ -243,11 +245,12 @@ class moduleMenu extends wg
global $app;
$this->setMenuTreeProps();
$title = $this->getTitle();
$treeProps = $this->props->pick(array('items', 'activeClass', 'activeIcon', 'activeKey', 'onClickItem', 'defaultNestedShow', 'changeActiveKey', 'isDropdownMenu', 'checkbox', 'checkOnClick', 'onCheck'));
$preserve = $app->getModuleName() . '-' . $app->getMethodName();
$isInSidebar = $this->parent instanceof sidebar;
$titleShow = $this->prop('titleShow');
$title = $this->getTitle();
$userTreeProps = $this->prop('tree');
$treeProps = $this->props->pick(array('items', 'activeClass', 'activeIcon', 'activeKey', 'onClickItem', 'defaultNestedShow', 'changeActiveKey', 'isDropdownMenu', 'checkbox', 'checkOnClick', 'onCheck'));
$preserve = $this->prop('preserve', $app->getModuleName() . '-' . $app->getMethodName());
$isInSidebar = $this->parent instanceof sidebar;
$titleShow = $this->prop('titleShow');
$header = $titleShow ? h::header
(
@@ -276,7 +279,8 @@ class moduleMenu extends wg
set::defaultNestedShow(true),
set::hover(true),
set::preserve($preserve),
set($treeProps)
set($treeProps),
set($userTreeProps)
),
$this->buildActions(),
$this->block('footer'),