引用: data:数据,默认从props里面取出 stta:折叠状态,true:折叠;false:打开,默认打开
data:[
{ title: "一级导航", icon: "rongqijiqun", href: "webg" },
{
title: "全局配置",
icon: "quanjupeizhi",
next: [
{ title: "二级导航", icon: "yonghu", href: "web" },
{ title: "二级导航", icon: "yonghu", href: "web" },
{ title: "二级导航", icon: "yonghu", href: "web" },
{ title: "二级导航", icon: "yonghu", href: "listtest" },
{ title: "二级导航", icon: "yonghu", href: "web" },
{ title: "二级导航", icon: "yonghu", href: "web" },
],
},
{
title: "一级导航",
icon: "yonghu",
next: [
{ title: "二级导航", icon: "yonghu", href: "web" },
{ title: "二级导航", icon: "yonghu", href: "web" },
],
},
{
title: "一级导航",
icon: "peizhiguanli",
next: [
{ title: "二级导航", icon: "yonghu", href: "web" },
{ title: "二级导航", icon: "yonghu", href: "web" },
],
},
选中背景色:rgb(191, 236, 214)
选中字体颜色:rgb(51, 153, 51)
未解决的问题:
(1) 引用该组件的父组件添加body样式:overflow-y:hidden
(2)当引用该组件外上面部分有一级导航时,更改less文件中wrapper样式中的height样式更改为:calc(100% - 顶部导航栏高度)。
(3)当引用该组件外上面部分有一级导航时,其兄弟组件外层应嵌套div,并给div添加样式height:calc(100% - 顶部导航高度),当其高度显示滚动条时,添加overflow-y:scroll属性