导航无限级菜单 java,Element NavMenu 无限级菜单

本文介绍了商业数据统计和报表中心的前端菜单配置,包括日统计、月统计、日报表和月报表的功能组件。在Home.vue文件中设置了头部、侧边栏和底部样式,并通过axios获取JSON数据来动态加载菜单。页面布局注重响应式设计,调整窗口大小时能自动适配。
摘要由CSDN通过智能技术生成

数据结构

menudata.json

{"data":[

{

"id": 1,

"path": "/home",

"menuName": "商业数据统计",

"component": "Home",

"childMenu":[{

"id": 2,

"path": "/commercial/dataAccount/Day",

"menuName": "日统计1",

"component": "DataAccountDay"

},

{

"id": 3,

"path": "/commercial/dataAccount/Month",

"menuName": "月统计1",

"component": "DataAccountMonth"

}]

},

{

"id": 4,

"path": "/home",

"menuName": "商业报表中心",

"component": "Home",

"childMenu":[{

"id": 5,

"path": "/commercial/baobiao/Day",

"menuName": "日报表1",

"component": "BaobiaoDay"

},

{

"id": 6,

"path": "/commercial/baobiao/Month",

"menuName": "月报表1",

"component": "BaobiaoMonth"

}]

}

]}

Home.vue

header

router

:default-active="routePath"

unique-opened

background-color="#1f3146"

text-color="#32acca"

active-text-color="#ffd04b"

>

footer

import NavMenu from "@/components/NavMenu.vue";

export default {

data() {

return {

containerHeight: "",

menuData: [],

routePath:"",

currentModuleChinese:"",

user: window.sessionStorage.getItem("user")

};

},

created() {

this.$axios.get("/mock/menudata + ".json").then(res => {-

this.menuData = res.data.data;

});

},

components: { NavMenu },

// watch:{

// $route(){

// console.log(this.$route.path)

// this.routePath = this.$route.path

// }

// },

mounted() {

console.log("mounted")

this.containerHeight = window.innerHeight + "px";

console.log($)

$(window).resize(function() {

console.log("hi")

$("#con").height($(window).height()-2);

});

}

};

.el-header {

background-color: #377fa9;

color: #fff;

height: 50px !important;

line-height: 50px !important;

}

.el-header .left img {

width: 120px;

vertical-align: middle;

}

.el-header .left span {

font-size: 20px;

color: #edf8ff;

margin-left: 15px;

}

.el-header .right {

float: right;

}

.el-header .right a {

color: #fff;

}

.el-aside {

/* color: #32acca !important; */

background: #1f3146 !important;

}

.el-menu {

border-right: none !important;

/* background: #1f3146 !important; */

}

.el-footer {

background: gray;

height: 40px !important;

line-height: 40px !important;

}

.el-footer {

border-top: 1px solid #ccc;

background: #f8fafd;

padding: 10px;

margin-left: 0;

}

.el-footer img {

vertical-align: middle;

width: 65px;

margin-right: 10px;

}

NavMenu.vue

{{item.menuName}}

{{item.menuName}}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值