描述
示例: add_menu_page(options)
功能: 注册后台菜单页面
参数
options
(Object) (Optional) 菜单配置
page_title
(String) (Required) 页面名称
menu_title
(String) (Required) 菜单显示名称
menu_slug
(String) (Required) 菜单别名,务必是唯一的
power
(Int) (Required) 权限值,用户高于此数值才能访问该页面
position
(Int) (Optional) 位置,越小越靠前,默认:10
icon
(String) (Optional) 图标,如 <i class=""el-icon-setting></i>。更多图标请参考此处
component
(Vue Component Object) (Optional) 页面内容(Vue组件)
component_url
(String) (Optional) 页面内容URL链接(URL是可访问的*.vue文件)
highlight_menu
(String) (Optional) 不显示此菜单(但允许导航到页面),导航到页面时,高亮指定菜单的 menu_slug
child_routes v3.8
(Array[Object]) (Optional) 对应VueRouter的children子路由
path
(String) (Require) 对应VueRouter的子路由path,使用时注意不带斜杠
name
(String) (Optional) 对应VueRouter的子路由name
component
(Vue Component Object) (Optional) 子路由内容(Vue组件)
component_url
(String) (Optional) 子路由内容URL链接(URL是可访问的*.vue文件)
position
(Number) (Optional) 在VueRouter中将作为route.meta.index存在,在路由动画中可用作参考
child_routes
(Array[Object]) (Optional) 多级子路由
注意: component 和 component_url 至少存在1个值(通常使用component_url)
返回
(Void) 无