Skip to content

模块菜单 moduleMenu ​

模块树使用含有 id、parent、name 的对象数组,每项可提供 url。根节点的 parent 为 0。activeKey 用于标记当前模块,closeLink 用于清除筛选。

php
moduleMenu
(
    set::modules([(object)['id' => 4, 'parent' => 0, 'name' => '客户端', 'url' => '/project-browse-4.html']]),
    set::activeKey(4),
    set::closeLink('/project-browse.html')
);

可以用 to::header(...) 和 to::footer(...) 增加模块树上下方的内容。

属性 ​

名称 类型 可选 声明默认值 说明
modulesarray否—模块对象数组。
activeKeyintstring是—当前模块标识。
settingLinkstring是—模块设置链接。
settingAppstring是""打开设置的应用。
closeLinkstring否—清除模块筛选的链接。
showDisplaybool是true显示视图设置项。
allTextstring是—未选中模块时使用的标题。
titlestring是—自定义菜单标题。
titleShowbool是true显示标题。
appstring是""打开模块链接的应用。
checkboxbool是—启用树节点复选。
preservestringbool是—保存树状态所用的键或开关。
treearray是—传给树组件的选项。
checkOnClickboolstring是—点击节点时切换选中状态。
appendSettingItemsarray是—追加到设置菜单的选项。
onCheckfunction是—节点勾选回调。
toggleSidebarbool是true显示侧边栏折叠按钮。
isInModalbool是false在对话框中使用模块菜单。
onClickItemfunction是—树节点点击回调。